diff --git a/tests/modeltests/custom_methods/models.py b/tests/modeltests/custom_methods/models.py index bd36562183..b964bff169 100644 --- a/tests/modeltests/custom_methods/models.py +++ b/tests/modeltests/custom_methods/models.py @@ -29,7 +29,7 @@ class Article(models.Model): cursor = connection.cursor() cursor.execute(""" SELECT id, headline, pub_date - FROM custom_methods_articles + FROM custom_methods_article WHERE pub_date = %s AND id != %s""", [str(self.pub_date), self.id]) # The asterisk in "(*row)" tells Python to expand the list into diff --git a/tests/modeltests/custom_pk/models.py b/tests/modeltests/custom_pk/models.py index 001552dbfe..2196c5b086 100644 --- a/tests/modeltests/custom_pk/models.py +++ b/tests/modeltests/custom_pk/models.py @@ -22,7 +22,6 @@ class Business(models.Model): employees = models.ManyToManyField(Employee) class Meta: verbose_name_plural = 'businesses' - module_name = 'businesses' def __repr__(self): return self.name @@ -77,9 +76,9 @@ True [Sears] # Queries across tables, involving primary key ->>> Employee.objects.get_list(businesses__name__exact='Sears') +>>> Employee.objects.get_list(business__name__exact='Sears') [Dan Jones, Fran Jones] ->>> Employee.objects.get_list(businesses__pk='Sears') +>>> Employee.objects.get_list(business__pk='Sears') [Dan Jones, Fran Jones] >>> Business.objects.get_list(employees__employee_code__exact='ABC123') diff --git a/tests/modeltests/manipulators/models.py b/tests/modeltests/manipulators/models.py index 1dd5615a75..1699db0dde 100644 --- a/tests/modeltests/manipulators/models.py +++ b/tests/modeltests/manipulators/models.py @@ -88,7 +88,7 @@ Ultimate Ella datetime.date(2005, 2, 13) # Test follow (inline editing) functionality. ->>> man = Musician.ChangeManipulator(m1, follow={"albums": True}) +>>> man = Musician.ChangeManipulator(m1, follow={"album": True}) >>> data = man.flatten_data() >>> sorted_list = data.items() >>> sorted_list.sort(lambda x, y: cmp(x[0], y[0])) diff --git a/tests/modeltests/many_to_many/models.py b/tests/modeltests/many_to_many/models.py index 5b1c6435db..8844610966 100644 --- a/tests/modeltests/many_to_many/models.py +++ b/tests/modeltests/many_to_many/models.py @@ -85,13 +85,13 @@ True >>> Publication.objects.get_list(pk=1) [The Python Journal] ->>> Publication.objects.get_list(articles__headline__startswith="NASA") +>>> Publication.objects.get_list(article__headline__startswith="NASA") [The Python Journal, Science News, Science Weekly] ->>> Publication.objects.get_list(articles__id__exact=1) +>>> Publication.objects.get_list(article__id__exact=1) [The Python Journal] ->>> Publication.objects.get_list(articles__pk=1) +>>> Publication.objects.get_list(article__pk=1) [The Python Journal] # If we delete a Publication, its Articles won't be able to access it. diff --git a/tests/modeltests/many_to_one/models.py b/tests/modeltests/many_to_one/models.py index 2874e9ba75..c3cb12afcf 100644 --- a/tests/modeltests/many_to_one/models.py +++ b/tests/modeltests/many_to_one/models.py @@ -98,7 +98,7 @@ This is a test 1 # The automatically joined table has a predictable name. ->>> Article.objects.get_list(reporter__first_name__exact='John', where=["many_to_one_articles__reporter.last_name='Smith'"]) +>>> Article.objects.get_list(reporter__first_name__exact='John', where=["many_to_one_article__reporter.last_name='Smith'"]) [This is a test, John's second story] # Find all Articles for the Reporter whose ID is 1. @@ -147,19 +147,19 @@ John Smith [John Smith] # Reporters can query in opposite direction of ForeignKey definition ->>> Reporter.objects.get_list(articles__id__exact=1) +>>> Reporter.objects.get_list(article__id__exact=1) [John Smith] ->>> Reporter.objects.get_list(articles__pk=1) +>>> Reporter.objects.get_list(article__pk=1) [John Smith] ->>> Reporter.objects.get_list(articles__headline__startswith='This') +>>> Reporter.objects.get_list(article__headline__startswith='This') [John Smith, John Smith, John Smith] ->>> Reporter.objects.get_list(articles__headline__startswith='This', distinct=True) +>>> Reporter.objects.get_list(article__headline__startswith='This', distinct=True) [John Smith] # Queries can go round in circles. ->>> Reporter.objects.get_list(articles__reporter__first_name__startswith='John') +>>> Reporter.objects.get_list(article__reporter__first_name__startswith='John') [John Smith, John Smith, John Smith, John Smith] ->>> Reporter.objects.get_list(articles__reporter__first_name__startswith='John', distinct=True) +>>> Reporter.objects.get_list(article__reporter__first_name__startswith='John', distinct=True) [John Smith] # Deletes that require joins are prohibited. diff --git a/tests/modeltests/one_to_one/models.py b/tests/modeltests/one_to_one/models.py index 4c35604d2c..3efc388253 100644 --- a/tests/modeltests/one_to_one/models.py +++ b/tests/modeltests/one_to_one/models.py @@ -79,9 +79,9 @@ Demon Dogs the restaurant Demon Dogs the place >>> Place.objects.get_object(pk=1) Demon Dogs the place ->>> Place.objects.get_object(restaurants__place__exact=1) +>>> Place.objects.get_object(restaurant__place__exact=1) Demon Dogs the place ->>> Place.objects.get_object(restaurants__pk=1) +>>> Place.objects.get_object(restaurant__pk=1) Demon Dogs the place # Add a Waiter to the Restaurant.