fix git_export tests

This commit is contained in:
Christine Lytwynec
2014-12-12 15:06:49 -05:00
parent e53263d937
commit b9668acb32

View File

@@ -69,13 +69,13 @@ class TestGitExport(CourseTestCase):
# Send bad url to get course not exported
with self.assertRaises(SystemExit) as ex:
with self.assertRaisesRegexp(CommandError, GitExportError.URL_BAD):
with self.assertRaisesRegexp(CommandError, str(GitExportError.URL_BAD)):
call_command('git_export', 'foo/bar/baz', 'silly',
stderr=StringIO.StringIO())
self.assertEqual(ex.exception.code, 1)
# Send bad course_id to get course not exported
with self.assertRaises(SystemExit) as ex:
with self.assertRaisesRegexp(CommandError, GitExportError.BAD_COURSE):
with self.assertRaisesRegexp(CommandError, str(GitExportError.BAD_COURSE)):
call_command('git_export', 'foo/bar:baz', 'silly',
stderr=StringIO.StringIO())
self.assertEqual(ex.exception.code, 1)
@@ -86,7 +86,7 @@ class TestGitExport(CourseTestCase):
"""
output = StringIO.StringIO()
with self.assertRaises(SystemExit):
with self.assertRaisesRegexp(CommandError, GitExportError.BAD_COURSE):
with self.assertRaisesRegexp(CommandError, str(GitExportError.BAD_COURSE)):
call_command(
'git_export', 'foo/bar:baz', 'silly',
stdout=output, stderr=output
@@ -96,7 +96,7 @@ class TestGitExport(CourseTestCase):
output = StringIO.StringIO()
with self.assertRaises(SystemExit):
with self.assertRaisesRegexp(CommandError, GitExportError.URL_BAD):
with self.assertRaisesRegexp(CommandError, str(GitExportError.URL_BAD)):
call_command(
'git_export', 'foo/bar/baz', 'silly',
stdout=output, stderr=output