summaryrefslogtreecommitdiff
path: root/tests/model_forms
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_forms')
-rw-r--r--tests/model_forms/models.py1
-rw-r--r--tests/model_forms/tests.py3
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/model_forms/models.py b/tests/model_forms/models.py
index 17aec29055..37c3b37864 100644
--- a/tests/model_forms/models.py
+++ b/tests/model_forms/models.py
@@ -211,6 +211,7 @@ class DerivedBook(Book, BookXtra):
class ExplicitPK(models.Model):
key = models.CharField(max_length=20, primary_key=True)
desc = models.CharField(max_length=20, blank=True, unique=True)
+
class Meta:
unique_together = ('key', 'desc')
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index 5388ec99d0..0ca96166bc 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -26,6 +26,7 @@ from .models import (Article, ArticleStatus, BetterWriter, BigInt, Book,
if test_images:
from .models import ImageFile, OptionalImageFile
+
class ImageFileForm(forms.ModelForm):
class Meta:
model = ImageFile
@@ -208,6 +209,7 @@ class ModelFormWithMedia(forms.ModelForm):
css = {
'all': ('/some/form/css',)
}
+
class Meta:
model = TextFile
fields = '__all__'
@@ -1722,6 +1724,7 @@ class OldFormForXTests(TestCase):
class CategoryForm(forms.ModelForm):
description = forms.CharField()
+
class Meta:
model = Category
fields = ['description', 'url']