diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py
index 620fa9e..4dc8c7a 100644
|
a
|
b
|
class PrimaryKeyUUIDModel(models.Model):
|
| 373 | 373 | id = models.UUIDField(primary_key=True, default=uuid.uuid4) |
| 374 | 374 | |
| 375 | 375 | |
| | 376 | class UUIDChild(PrimaryKeyUUIDModel): |
| | 377 | pass |
| | 378 | |
| | 379 | |
| | 380 | class UUIDGrandchild(UUIDChild): |
| | 381 | pass |
| | 382 | |
| | 383 | |
| 376 | 384 | class RelatedToUUIDModel(models.Model): |
| 377 | 385 | uuid_fk = models.ForeignKey('PrimaryKeyUUIDModel') |
diff --git a/tests/model_fields/test_uuid.py b/tests/model_fields/test_uuid.py
index 28e1191..0e67033 100644
|
a
|
b
|
class TestAsPrimaryKey(TestCase):
|
| 124 | 124 | self.assertTrue(u2_found) |
| 125 | 125 | self.assertEqual(PrimaryKeyUUIDModel.objects.count(), 2) |
| 126 | 126 | |
| | 127 | def test_uuid_grandchild(self): |
| | 128 | from .models import UUIDGrandchild |
| | 129 | a = UUIDGrandchild() |
| | 130 | a.save() |
| | 131 | a.save() # regression for #24608 |
| | 132 | |
| 127 | 133 | def test_underlying_field(self): |
| 128 | 134 | pk_model = PrimaryKeyUUIDModel.objects.create() |
| 129 | 135 | RelatedToUUIDModel.objects.create(uuid_fk=pk_model) |