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
c144b251
Commit
c144b251
authored
Feb 01, 2013
by
Deena Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests in test_views.py
parent
25aca586
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
5 deletions
+49
-5
cms/djangoapps/contentstore/tests/factories.py
+49
-5
cms/djangoapps/contentstore/tests/test_views.py
+0
-0
No files found.
cms/djangoapps/contentstore/tests/factories.py
View file @
c144b251
from
factory
import
Factory
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.django
import
modulestore
from
datetime
import
datetime
import
uuid
from
time
import
gmtime
from
uuid
import
uuid4
from
xmodule.timeparse
import
stringify_time
from
django.contrib.auth.models
import
Group
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.django
import
modulestore
from
xmodule.timeparse
import
stringify_time
from
student.models
import
(
User
,
UserProfile
,
Registration
,
CourseEnrollmentAllowed
)
from
django.contrib.auth.models
import
Group
def
XMODULE_COURSE_CREATION
(
class_to_create
,
**
kwargs
):
return
XModuleCourseFactory
.
_create
(
class_to_create
,
**
kwargs
)
...
...
@@ -114,4 +121,42 @@ class ItemFactory(XModuleItemFactory):
parent_location
=
'i4x://MITx/999/course/Robot_Super_Course'
template
=
'i4x://edx/templates/chapter/Empty'
display_name
=
'Section One'
\ No newline at end of file
display_name
=
'Section One'
class
UserProfileFactory
(
Factory
):
FACTORY_FOR
=
UserProfile
user
=
None
name
=
'Robot Studio'
courseware
=
'course.xml'
class
RegistrationFactory
(
Factory
):
FACTORY_FOR
=
Registration
user
=
None
activation_key
=
uuid
.
uuid4
()
.
hex
class
UserFactory
(
Factory
):
FACTORY_FOR
=
User
username
=
'robot'
email
=
'robot@edx.org'
password
=
'test'
first_name
=
'Robot'
last_name
=
'Tester'
is_staff
=
False
is_active
=
True
is_superuser
=
False
last_login
=
datetime
.
now
()
date_joined
=
datetime
.
now
()
class
GroupFactory
(
Factory
):
FACTORY_FOR
=
Group
name
=
'test_group'
class
CourseEnrollmentAllowedFactory
(
Factory
):
FACTORY_FOR
=
CourseEnrollmentAllowed
email
=
'test@edx.org'
course_id
=
'edX/test/2012_Fall'
cms/djangoapps/contentstore/tests/test_views.py
View file @
c144b251
This diff is collapsed.
Click to expand it.
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