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
7884e2c6
Commit
7884e2c6
authored
Jan 22, 2013
by
Deena Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests
parent
35650233
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
lms/djangoapps/courseware/tests/test_courses.py
+2
-0
lms/djangoapps/courseware/tests/test_views.py
+7
-2
No files found.
lms/djangoapps/courseware/tests/test_courses.py
View file @
7884e2c6
...
@@ -6,6 +6,7 @@ from django.contrib.auth.models import User
...
@@ -6,6 +6,7 @@ from django.contrib.auth.models import User
from
student.models
import
CourseEnrollment
from
student.models
import
CourseEnrollment
import
courseware.courses
as
courses
import
courseware.courses
as
courses
from
xmodule.modulestore.xml
import
XMLModuleStore
class
CoursesTestCase
(
TestCase
):
class
CoursesTestCase
(
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -16,6 +17,7 @@ class CoursesTestCase(TestCase):
...
@@ -16,6 +17,7 @@ class CoursesTestCase(TestCase):
self
.
enrollment
=
CourseEnrollment
.
objects
.
get_or_create
(
user
=
self
.
user
,
self
.
enrollment
=
CourseEnrollment
.
objects
.
get_or_create
(
user
=
self
.
user
,
course_id
=
self
.
course_id
,
course_id
=
self
.
course_id
,
created
=
self
.
date
)[
0
]
created
=
self
.
date
)[
0
]
self
.
xml_modulestore
=
XMLModuleStore
()
def
test_get_course_by_id
(
self
):
def
test_get_course_by_id
(
self
):
courses
.
get_course_by_id
(
self
.
course_id
)
courses
.
get_course_by_id
(
self
.
course_id
)
lms/djangoapps/courseware/tests/test_views.py
View file @
7884e2c6
...
@@ -61,8 +61,9 @@ class ViewsTestCase(TestCase):
...
@@ -61,8 +61,9 @@ class ViewsTestCase(TestCase):
mock_module
,
True
)
mock_module
,
True
)
def
test_index
(
self
):
def
test_index
(
self
):
print
modulestore
()
pass
assert
False
#print modulestore()
#assert False
def
test_registered_for_course
(
self
):
def
test_registered_for_course
(
self
):
self
.
assertFalse
(
views
.
registered_for_course
(
'Basketweaving'
,
None
))
self
.
assertFalse
(
views
.
registered_for_course
(
'Basketweaving'
,
None
))
...
@@ -72,3 +73,7 @@ class ViewsTestCase(TestCase):
...
@@ -72,3 +73,7 @@ class ViewsTestCase(TestCase):
mock_course
=
MagicMock
()
mock_course
=
MagicMock
()
mock_course
.
id
=
self
.
course_id
mock_course
.
id
=
self
.
course_id
self
.
assertTrue
(
views
.
registered_for_course
(
mock_course
,
self
.
user
))
self
.
assertTrue
(
views
.
registered_for_course
(
mock_course
,
self
.
user
))
def
test_jump_to
(
self
):
self
.
assertRaises
(
Http404
,
views
.
jump_to
,
'foo'
,
'bar'
,
())
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