From 6e6b92d7594b3e10f7464fc8c488c8a2731876bb Mon Sep 17 00:00:00 2001 From: Brandon Taylor Date: Wed, 12 Oct 2016 22:14:22 -0400 Subject: [PATCH] Skipped UUID-pk model if Django less than 1.8 --- sample_project/app/tests.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sample_project/app/tests.py b/sample_project/app/tests.py index 536855c..725f557 100644 --- a/sample_project/app/tests.py +++ b/sample_project/app/tests.py @@ -33,12 +33,13 @@ class TestSortableModel(SortableMixin): return self.title -class TestNonAutoFieldModel(SortableMixin): - id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) - order = models.PositiveIntegerField(editable=False, db_index=True) +if VERSION > (1, 8): + class TestNonAutoFieldModel(SortableMixin): + id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) + order = models.PositiveIntegerField(editable=False, db_index=True) - class Meta: - ordering = ['order'] + class Meta: + ordering = ['order'] class SortableTestCase(TestCase):