Ticket #24687: 24687-test.diff

File 24687-test.diff, 816 bytes (added by Tim Graham, 10 years ago)
  • tests/select_related/tests.py

    diff --git a/tests/select_related/tests.py b/tests/select_related/tests.py
    index 667ac2f..3e5f270 100644
    a b class SelectRelatedValidationTests(TestCase):  
    182182        with self.assertRaisesMessage(FieldError, self.non_relational_error % ('name', '(none)')):
    183183            list(Domain.objects.select_related('name'))
    184184
     185    def test_non_relational_field_nested(self):
     186        with self.assertRaisesMessage(FieldError, self.non_relational_error % ('name', 'family')):
     187            list(Species.objects.select_related('genus__name'))
     188
    185189    def test_many_to_many_field(self):
    186190        with self.assertRaisesMessage(FieldError, self.invalid_error % ('toppings', '(none)')):
    187191            list(Pizza.objects.select_related('toppings'))
Back to Top