Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
3816ac2a
Commit
3816ac2a
authored
Nov 10, 2014
by
Carson Gee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct unresolved ugettext_lazy error strings in git_export command
parent
b0b1744e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
cms/djangoapps/contentstore/management/commands/git_export.py
+2
-2
cms/djangoapps/contentstore/management/commands/tests/test_git_export.py
+28
-0
No files found.
cms/djangoapps/contentstore/management/commands/git_export.py
View file @
3816ac2a
...
...
@@ -62,7 +62,7 @@ class Command(BaseCommand):
try
:
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
args
[
0
])
except
InvalidKeyError
:
raise
CommandError
(
GitExportError
.
BAD_COURSE
)
raise
CommandError
(
_
(
GitExportError
.
BAD_COURSE
)
)
try
:
git_export_utils
.
export_to_git
(
...
...
@@ -72,4 +72,4 @@ class Command(BaseCommand):
options
.
get
(
'rdir'
,
None
)
)
except
git_export_utils
.
GitExportError
as
ex
:
raise
CommandError
(
str
(
ex
))
raise
CommandError
(
_
(
ex
.
message
))
cms/djangoapps/contentstore/management/commands/tests/test_git_export.py
View file @
3816ac2a
...
...
@@ -80,6 +80,34 @@ class TestGitExport(CourseTestCase):
stderr
=
StringIO
.
StringIO
())
self
.
assertEqual
(
ex
.
exception
.
code
,
1
)
def
test_error_output
(
self
):
"""
Verify that error output is actually resolved as the correct string
"""
output
=
StringIO
.
StringIO
()
with
self
.
assertRaises
(
SystemExit
):
with
self
.
assertRaisesRegexp
(
CommandError
,
GitExportError
.
BAD_COURSE
):
call_command
(
'git_export'
,
'foo/bar:baz'
,
'silly'
,
stdout
=
output
,
stderr
=
output
)
self
.
assertIn
(
'Bad course location provided'
,
output
.
getvalue
())
output
.
close
()
output
=
StringIO
.
StringIO
()
with
self
.
assertRaises
(
SystemExit
):
with
self
.
assertRaisesRegexp
(
CommandError
,
GitExportError
.
URL_BAD
):
call_command
(
'git_export'
,
'foo/bar/baz'
,
'silly'
,
stdout
=
output
,
stderr
=
output
)
self
.
assertIn
(
'Non writable git url provided. Expecting something like:'
' git@github.com:mitocw/edx4edx_lite.git'
,
output
.
getvalue
()
)
output
.
close
()
def
test_bad_git_url
(
self
):
"""
Test several bad URLs for validation
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment