Commit a83623d8 authored by Michal Čihař's avatar Michal Čihař

Remove Django 1.5 compatibility code

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 14586517
...@@ -29,12 +29,6 @@ from django.core.management import call_command ...@@ -29,12 +29,6 @@ from django.core.management import call_command
from django.core.management.base import CommandError from django.core.management.base import CommandError
import django import django
# Django 1.5 changes behavior here
if django.VERSION >= (1, 5):
COMMAND_EXCEPTION = CommandError
else:
COMMAND_EXCEPTION = SystemExit
class ImportProjectTest(RepoTestCase): class ImportProjectTest(RepoTestCase):
def test_import(self): def test_import(self):
...@@ -65,7 +59,7 @@ class ImportProjectTest(RepoTestCase): ...@@ -65,7 +59,7 @@ class ImportProjectTest(RepoTestCase):
def test_import_invalid(self): def test_import_invalid(self):
project = self.create_project() project = self.create_project()
self.assertRaises( self.assertRaises(
COMMAND_EXCEPTION, CommandError,
call_command, call_command,
'import_project', 'import_project',
'test', 'test',
...@@ -149,7 +143,7 @@ class ImportProjectTest(RepoTestCase): ...@@ -149,7 +143,7 @@ class ImportProjectTest(RepoTestCase):
Test of correct handling of missing project. Test of correct handling of missing project.
''' '''
self.assertRaises( self.assertRaises(
COMMAND_EXCEPTION, CommandError,
call_command, call_command,
'import_project', 'import_project',
'test', 'test',
...@@ -164,7 +158,7 @@ class ImportProjectTest(RepoTestCase): ...@@ -164,7 +158,7 @@ class ImportProjectTest(RepoTestCase):
''' '''
self.create_project() self.create_project()
self.assertRaises( self.assertRaises(
COMMAND_EXCEPTION, CommandError,
call_command, call_command,
'import_project', 'import_project',
'test', 'test',
...@@ -244,14 +238,14 @@ class CheckGitTest(RepoTestCase): ...@@ -244,14 +238,14 @@ class CheckGitTest(RepoTestCase):
def test_nonexisting_project(self): def test_nonexisting_project(self):
self.assertRaises( self.assertRaises(
COMMAND_EXCEPTION, CommandError,
self.do_test, self.do_test,
'notest', 'notest',
) )
def test_nonexisting_subproject(self): def test_nonexisting_subproject(self):
self.assertRaises( self.assertRaises(
COMMAND_EXCEPTION, CommandError,
self.do_test, self.do_test,
'test/notest', 'test/notest',
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment