From 9f76ea1eaad0db0183fa3b5bade16392db0cafbd Mon Sep 17 00:00:00 2001 From: Anssi Kääriäinen Date: Sat, 2 Nov 2013 21:16:33 +0200 Subject: Fixed #21375 -- related_name='+' clashed with other '+' names --- tests/model_validation/models.py | 21 +++++++++++++++++++++ tests/model_validation/tests.py | 2 ++ 2 files changed, 23 insertions(+) (limited to 'tests') diff --git a/tests/model_validation/models.py b/tests/model_validation/models.py index 9a2a5f7cd0..d2e77cbccc 100644 --- a/tests/model_validation/models.py +++ b/tests/model_validation/models.py @@ -25,3 +25,24 @@ class ThingWithIterableChoices(models.Model): # Testing choices= Iterable of Iterables # See: https://code.djangoproject.com/ticket/20430 thing = models.CharField(max_length=100, blank=True, choices=Things()) + + class Meta: + # Models created as unmanaged as these aren't ever queried + managed = False + + +class ManyToManyRel(models.Model): + thing1 = models.ManyToManyField(ThingWithIterableChoices, related_name='+') + thing2 = models.ManyToManyField(ThingWithIterableChoices, related_name='+') + + class Meta: + # Models created as unmanaged as these aren't ever queried + managed = False + +class FKRel(models.Model): + thing1 = models.ForeignKey(ThingWithIterableChoices, related_name='+') + thing2 = models.ForeignKey(ThingWithIterableChoices, related_name='+') + + class Meta: + # Models created as unmanaged as these aren't ever queried + managed = False diff --git a/tests/model_validation/tests.py b/tests/model_validation/tests.py index ffd0d89412..494af97f96 100644 --- a/tests/model_validation/tests.py +++ b/tests/model_validation/tests.py @@ -10,4 +10,6 @@ class ModelValidationTest(TestCase): # Validation Tests: # * choices= Iterable of Iterables # See: https://code.djangoproject.com/ticket/20430 + # * related_name='+' doesn't clash with another '+' + # See: https://code.djangoproject.com/ticket/21375 management.call_command("validate", stdout=six.StringIO()) -- cgit v1.3