Created
October 14, 2013 09:46
-
-
Save mjtamlyn/6973348 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py | |
index 2f94f64..8b864c3 100644 | |
--- a/tests/model_forms/tests.py | |
+++ b/tests/model_forms/tests.py | |
@@ -1820,11 +1820,14 @@ class ModelFormInheritanceTests(TestCase): | |
class ModelForm(forms.ModelForm): | |
class Meta: | |
model = Writer | |
- fields = '__all__' | |
+ fields = ['name'] | |
class Mixin(object): | |
age = None | |
+ class NameMixin(object): | |
+ name = None | |
+ | |
class Form(forms.Form): | |
age = forms.IntegerField() | |
@@ -1838,3 +1841,5 @@ class ModelFormInheritanceTests(TestCase): | |
self.assertEqual(list(type(str('NewForm'), (ModelForm, Mixin, Form), {})().fields.keys()), ['name']) | |
self.assertEqual(list(type(str('NewForm'), (ModelForm, Form, Mixin), {})().fields.keys()), ['name', 'age']) | |
self.assertEqual(list(type(str('NewForm'), (ModelForm, Form), {'age': None})().fields.keys()), ['name']) | |
+ self.assertEqual(list(type(str('NewForm'), (NameMixin, ModelForm), {})().fields.keys()), []) | |
+ self.assertEqual(list(type(str('NewForm'), (ModelForm,), {'name': None})().fields.keys()), []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment