Ticket #30798: test-30798.diff

File test-30798.diff, 844 bytes (added by Mariusz Felisiak, 5 years ago)

Regression test.

  • tests/invalid_models_tests/test_models.py

    diff --git a/tests/invalid_models_tests/test_models.py b/tests/invalid_models_tests/test_models.py
    index 0f1d1e4dc3..2a7bf02a73 100644
    a b class OtherModelTests(SimpleTestCase):  
    824824        with register_lookup(models.CharField, Lower):
    825825            self.assertEqual(Model.check(), [])
    826826
     827    def test_ordering_pointing_to_related_model_pk(self):
     828        class Parent(models.Model):
     829            pass
     830
     831        class Child(models.Model):
     832            parent = models.ForeignKey(Parent, models.CASCADE)
     833
     834            class Meta:
     835                ordering = ('parent__pk',)
     836
     837        self.assertFalse(Child.check())
     838
    827839    def test_ordering_pointing_to_foreignkey_field(self):
    828840        class Parent(models.Model):
    829841            pass
Back to Top