Merge pull request #6238 from edx/clytwynec/fix_failing_git_export_tests

fix git_export tests
This commit is contained in:
Christine Lytwynec
2014-12-12 17:28:23 -05:00

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