diff --git a/src/postorius/tests/mailman_api_tests/test_list_bans.py b/src/postorius/tests/mailman_api_tests/test_list_bans.py
index 7e315e4..9c69b18 100644
--- a/src/postorius/tests/mailman_api_tests/test_list_bans.py
+++ b/src/postorius/tests/mailman_api_tests/test_list_bans.py
@@ -19,9 +19,6 @@
from __future__ import absolute_import, print_function, unicode_literals
-import django
-
-from distutils.version import StrictVersion
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
@@ -61,16 +58,16 @@
response = self.client.get(self.url)
self.assertEqual(response.status_code, 200)
self.assertTrue('addban_form' in response.context)
- if StrictVersion(django.get_version()) < StrictVersion('1.10'):
- # Django < 1.10 XXX: remove when support for 1.9 is dropped
- self.assertContains(
- response, '')
- else:
+ try:
# Django 1.10
self.assertContains(
response, '')
+ except AssertionError:
+ # Django < 1.10 XXX: remove when support for 1.9 is dropped
+ self.assertContains(
+ response, '')
self.assertContains(
response, '')