Kaydet (Commit) edecbb55 authored tarafından Aymeric Augustin's avatar Aymeric Augustin

Minor cleanup in select_related_regress tests.

üst f574220f
...@@ -163,17 +163,13 @@ class SelectRelatedRegressTests(TestCase): ...@@ -163,17 +163,13 @@ class SelectRelatedRegressTests(TestCase):
self.assertTrue('LEFT OUTER' in str(qs.query)) self.assertTrue('LEFT OUTER' in str(qs.query))
def test_regression_19870(self): def test_regression_19870(self):
"""
Regression for #19870
"""
hen = Hen.objects.create(name='Hen') hen = Hen.objects.create(name='Hen')
Chick.objects.create(name='Chick', mother=hen) Chick.objects.create(name='Chick', mother=hen)
self.assertEqual(Chick.objects.all()[0].mother.name, 'Hen') self.assertEqual(Chick.objects.all()[0].mother.name, 'Hen')
self.assertEqual(Chick.objects.select_related()[0].mother.name, 'Hen') self.assertEqual(Chick.objects.select_related()[0].mother.name, 'Hen')
def test_ticket_10733(self): def test_regression_10733(self):
a = A.objects.create(name='a', lots_of_text='lots_of_text_a', a_field='a_field') a = A.objects.create(name='a', lots_of_text='lots_of_text_a', a_field='a_field')
b = B.objects.create(name='b', lots_of_text='lots_of_text_b', b_field='b_field') b = B.objects.create(name='b', lots_of_text='lots_of_text_b', b_field='b_field')
c = C.objects.create(name='c', lots_of_text='lots_of_text_c', is_published=True, c = C.objects.create(name='c', lots_of_text='lots_of_text_c', is_published=True,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment