summaryrefslogtreecommitdiff
path: root/tests/modeladmin/tests.py
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-05-10 12:55:30 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-05-10 12:55:30 +0100
commitcb4b0de49e027f09f8abe63e2fa43f60fc1ef13f (patch)
tree712da07b2b80fc503aea683c096a8774dceaad01 /tests/modeladmin/tests.py
parentf6801a234fb9460eac80d146534ac340e178c466 (diff)
parentbdd285723f9b0044eca690634c412c1c3eec76c0 (diff)
Merge branch 'master' into schema-alteration
Diffstat (limited to 'tests/modeladmin/tests.py')
-rw-r--r--tests/modeladmin/tests.py72
1 files changed, 1 insertions, 71 deletions
diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py
index e5450ab8ff..0d933bc1f9 100644
--- a/tests/modeladmin/tests.py
+++ b/tests/modeladmin/tests.py
@@ -229,9 +229,6 @@ class ModelAdminTests(TestCase):
class AdminBandForm(forms.ModelForm):
delete = forms.BooleanField()
- class Meta:
- model = Band
-
class BandAdmin(ModelAdmin):
form = AdminBandForm
@@ -319,8 +316,7 @@ class ModelAdminTests(TestCase):
'</select>' % (band2.id, self.band.id))
class AdminConcertForm(forms.ModelForm):
- class Meta:
- model = Concert
+ pass
def __init__(self, *args, **kwargs):
super(AdminConcertForm, self).__init__(*args, **kwargs)
@@ -617,17 +613,6 @@ class ValidationTests(unittest.TestCase):
)
class ValidationTestModelAdmin(ModelAdmin):
- fieldsets = (("General", {"fields": ("non_existent_field",)}),)
-
- six.assertRaisesRegex(self,
- ImproperlyConfigured,
- "'ValidationTestModelAdmin.fieldsets\[0\]\[1\]\['fields'\]' refers to field 'non_existent_field' that is missing from the form.",
- validate,
- ValidationTestModelAdmin,
- ValidationTestModel,
- )
-
- class ValidationTestModelAdmin(ModelAdmin):
fieldsets = (("General", {"fields": ("name",)}),)
validate(ValidationTestModelAdmin, ValidationTestModel)
@@ -685,22 +670,6 @@ class ValidationTests(unittest.TestCase):
def test_fieldsets_with_custom_form_validation(self):
class BandAdmin(ModelAdmin):
-
- fieldsets = (
- ('Band', {
- 'fields': ('non_existent_field',)
- }),
- )
-
- six.assertRaisesRegex(self,
- ImproperlyConfigured,
- "'BandAdmin.fieldsets\[0\]\[1\]\['fields'\]' refers to field 'non_existent_field' that is missing from the form.",
- validate,
- BandAdmin,
- Band,
- )
-
- class BandAdmin(ModelAdmin):
fieldsets = (
('Band', {
'fields': ('name',)
@@ -710,32 +679,8 @@ class ValidationTests(unittest.TestCase):
validate(BandAdmin, Band)
class AdminBandForm(forms.ModelForm):
- class Meta:
- model = Band
-
- class BandAdmin(ModelAdmin):
- form = AdminBandForm
-
- fieldsets = (
- ('Band', {
- 'fields': ('non_existent_field',)
- }),
- )
-
- six.assertRaisesRegex(self,
- ImproperlyConfigured,
- "'BandAdmin.fieldsets\[0]\[1\]\['fields'\]' refers to field 'non_existent_field' that is missing from the form.",
- validate,
- BandAdmin,
- Band,
- )
-
- class AdminBandForm(forms.ModelForm):
delete = forms.BooleanField()
- class Meta:
- model = Band
-
class BandAdmin(ModelAdmin):
form = AdminBandForm
@@ -1371,21 +1316,6 @@ class ValidationTests(unittest.TestCase):
ValidationTestModel,
)
- class ValidationTestInline(TabularInline):
- model = ValidationTestInlineModel
- fields = ("non_existent_field",)
-
- class ValidationTestModelAdmin(ModelAdmin):
- inlines = [ValidationTestInline]
-
- six.assertRaisesRegex(self,
- ImproperlyConfigured,
- "'ValidationTestInline.fields' refers to field 'non_existent_field' that is missing from the form.",
- validate,
- ValidationTestModelAdmin,
- ValidationTestModel,
- )
-
def test_fk_name_validation(self):
class ValidationTestInline(TabularInline):