summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polyconseil.fr>2018-06-18 14:01:19 +0200
committerRaphaël Barrois <raphael.barrois@polyconseil.fr>2018-06-18 14:01:19 +0200
commite677698e8330bc3374054a6669df694a85ea54e6 (patch)
treea965f99c92b481fbf7cb3873b1628f2e9779bf6b /tests
parent76be56977c8c81e00966b1c49f82ecbb0361b904 (diff)
downloadsemantic-version-e677698e8330bc3374054a6669df694a85ea54e6.tar.gz
Adapt code to Django>=1.11.
Drop compatibility layer for Django<1.11.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_django.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/tests/test_django.py b/tests/test_django.py
index 1c3c46a..273633c 100644
--- a/tests/test_django.py
+++ b/tests/test_django.py
@@ -139,7 +139,6 @@ class DjangoFieldTestCase(unittest.TestCase):
self.assertEqual(Version('23.0.0'), obj2.version)
self.assertEqual(Version('0.1.2+3.4.5-6', partial=True), obj2.partial)
- @unittest.skipIf(django.VERSION[:2] < (1, 8), "Django<1.8 casts values on setattr")
def test_invalid_input(self):
v = models.VersionModel(version='0.1.1', spec='blah')
self.assertRaises(ValueError, v.full_clean)
@@ -147,11 +146,6 @@ class DjangoFieldTestCase(unittest.TestCase):
v2 = models.VersionModel(version='0.1', spec='==0.1.1,!=0.1.1-alpha')
self.assertRaises(ValueError, v2.full_clean)
- @unittest.skipUnless(django.VERSION[:2] < (1, 8), "Django>=1.8 doesn't mangle setattr")
- def test_invalid_input_full_clean(self):
- self.assertRaises(ValueError, models.VersionModel, version='0.1.1', spec='blah')
- self.assertRaises(ValueError, models.VersionModel, version='0.1', spec='==0.1.1,!=0.1.1-alpha')
-
def test_partial(self):
obj = models.PartialVersionModel(partial=Version('0.1.0'))
@@ -244,8 +238,7 @@ class FullMigrateTests(TransactionTestCase):
call_command('migrate', verbosity=0)
with connection.cursor() as cursor:
table_list = connection.introspection.get_table_list(cursor)
- if django.VERSION[:2] >= (1, 8):
- table_list = [t.name for t in connection.introspection.get_table_list(cursor)]
+ table_list = [t.name for t in connection.introspection.get_table_list(cursor)]
self.assertIn('django_test_app_versionmodel', table_list)