summaryrefslogtreecommitdiff
path: root/tests/model_formsets
diff options
context:
space:
mode:
authorAdam Chainz <adam@adamj.eu>2016-03-18 14:24:29 +0000
committerTim Graham <timograham@gmail.com>2016-09-09 17:16:42 -0400
commit652bcc6f5fa9084768890488fec5208e082c2add (patch)
treec3e6977924fe84329303c980d20b408139dfad8b /tests/model_formsets
parentbae64dd0f13ba247448197ecf83cdc7a80691bb4 (diff)
Refs #25415 -- Fixed invalid models in the test suite.
Diffstat (limited to 'tests/model_formsets')
-rw-r--r--tests/model_formsets/models.py2
-rw-r--r--tests/model_formsets/tests.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/model_formsets/models.py b/tests/model_formsets/models.py
index 7b7337fd52..0bf56189a7 100644
--- a/tests/model_formsets/models.py
+++ b/tests/model_formsets/models.py
@@ -166,7 +166,7 @@ class MexicanRestaurant(Restaurant):
class ClassyMexicanRestaurant(MexicanRestaurant):
- restaurant = models.OneToOneField(MexicanRestaurant, models.CASCADE, parent_link=True, primary_key=True)
+ the_restaurant = models.OneToOneField(MexicanRestaurant, models.CASCADE, parent_link=True, primary_key=True)
tacos_are_yummy = models.BooleanField(default=False)
diff --git a/tests/model_formsets/tests.py b/tests/model_formsets/tests.py
index 7ac1700691..60acc463cc 100644
--- a/tests/model_formsets/tests.py
+++ b/tests/model_formsets/tests.py
@@ -1461,7 +1461,7 @@ class ModelFormsetTest(TestCase):
# a formset for a Model that has a custom primary key that still needs to be
# added to the formset automatically
FormSet = modelformset_factory(ClassyMexicanRestaurant, fields=["tacos_are_yummy"])
- self.assertEqual(sorted(FormSet().forms[0].fields.keys()), ['restaurant', 'tacos_are_yummy'])
+ self.assertEqual(sorted(FormSet().forms[0].fields.keys()), ['tacos_are_yummy', 'the_restaurant'])
def test_model_formset_with_initial_model_instance(self):
# has_changed should compare model instance and primary key