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
16773aac
Commit
16773aac
authored
Mar 19, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More factory refactoring.
parent
3576a315
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
common/djangoapps/terrain/factories.py
+2
-2
lms/djangoapps/courseware/features/common.py
+1
-2
No files found.
common/djangoapps/terrain/factories.py
View file @
16773aac
...
...
@@ -38,7 +38,7 @@ class GroupFactory(GroupFactory):
@world.absorb
class
CourseEnrollment
(
CourseEnrollment
):
class
CourseEnrollment
Factory
(
CourseEnrollment
):
"""
Courses that the user is enrolled in
"""
...
...
@@ -46,7 +46,7 @@ class CourseEnrollment(CourseEnrollment):
@world.absorb
class
CourseEnrollmentAllowed
(
CourseEnrollmentAllowed
):
class
CourseEnrollmentAllowed
Factory
(
CourseEnrollmentAllowed
):
"""
Users allowed to enroll in the course outside of the usual window
"""
...
...
lms/djangoapps/courseware/features/common.py
View file @
16773aac
from
lettuce
import
world
,
step
from
django.core.management
import
call_command
from
nose.tools
import
assert_equals
,
assert_in
from
lettuce.django
import
django_url
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
from
student.models
import
CourseEnrollment
from
xmodule.modulestore
import
Location
...
...
@@ -123,6 +121,7 @@ def i_am_registered_for_the_course(step, course):
u
=
User
.
objects
.
get
(
username
=
'robot'
)
# If the user is not already enrolled, enroll the user.
# TODO: change to factory
CourseEnrollment
.
objects
.
get_or_create
(
user
=
u
,
course_id
=
course_id
(
course
))
world
.
log_in
(
'robot@edx.org'
,
'test'
)
...
...
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