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
f08dc428
Commit
f08dc428
authored
Jan 24, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some dummy arg parsing tests
parent
bbec6266
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
+33
-0
No files found.
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
0 → 100644
View file @
f08dc428
"""
Unittests for importing a course via management command
"""
import
unittest
from
django.core.management
import
CommandError
from
contentstore.management.commands.migrate_to_split
import
Command
class
TestArgParsing
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
command
=
Command
()
def
test_no_args
(
self
):
errstring
=
"migrate_to_split requires at least two arguments"
with
self
.
assertRaisesRegexp
(
CommandError
,
errstring
):
self
.
command
.
handle
()
def
test_invalid_location
(
self
):
errstring
=
"Invalid location string"
with
self
.
assertRaisesRegexp
(
CommandError
,
errstring
):
self
.
command
.
handle
(
"foo"
,
"bar"
)
def
test_nonexistant_user_id
(
self
):
errstring
=
"No user exists with ID 99"
with
self
.
assertRaisesRegexp
(
CommandError
,
errstring
):
self
.
command
.
handle
(
"i4x://org/course/category/name"
,
"99"
)
def
test_nonexistant_user_email
(
self
):
errstring
=
"No user exists with email fake@example.com"
with
self
.
assertRaisesRegexp
(
CommandError
,
errstring
):
self
.
command
.
handle
(
"i4x://org/course/category/name"
,
"fake@example.com"
)
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