Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

magic-removal: Fixed some model tests that broke with removal of plur…

…alization in [2111].

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2125 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit faf9ff6316fd575f9c03f5a6766766eb00b325aa 1 parent 650d26d
@jkocherhans jkocherhans authored
View
2  tests/modeltests/custom_methods/models.py
@@ -29,7 +29,7 @@ def get_articles_from_same_day_2(self):
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
View
5 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 @@ def __repr__(self):
[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')
View
2  tests/modeltests/manipulators/models.py
@@ -88,7 +88,7 @@ def __repr__(self):
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]))
View
6 tests/modeltests/many_to_many/models.py
@@ -85,13 +85,13 @@ def __repr__(self):
>>> 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.
View
14 tests/modeltests/many_to_one/models.py
@@ -98,7 +98,7 @@ def __repr__(self):
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 @@ def __repr__(self):
[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.
View
4 tests/modeltests/one_to_one/models.py
@@ -79,9 +79,9 @@ def __repr__(self):
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.
Please sign in to comment.
Something went wrong with that request. Please try again.