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
af2690fc
Commit
af2690fc
authored
Feb 22, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update lettuce test framework to use a course factory instead of the studio UI for creating courses
parent
c11d627c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
7 deletions
+26
-7
cms/djangoapps/contentstore/features/advanced-settings.feature
+2
-2
cms/djangoapps/contentstore/features/common.py
+17
-5
common/djangoapps/terrain/factories.py
+7
-0
No files found.
cms/djangoapps/contentstore/features/advanced-settings.feature
View file @
af2690fc
...
...
@@ -27,4 +27,5 @@ Feature: Advanced (manual) course policy
Given
I have opened a new course in Studio
When
I select the Advanced Settings
And
I create a JSON object
Then
it is displayed as formatted
\ No newline at end of file
Then
it is displayed as formatted
cms/djangoapps/contentstore/features/common.py
View file @
af2690fc
from
lettuce
import
world
,
step
from
factories
import
*
from
lettuce.django
import
django_url
from
nose.tools
import
assert_true
from
nose.tools
import
assert_equal
import
xmodule.modulestore.django
from
selenium.webdriver.support.ui
import
WebDriverWait
from
terrain.factories
import
UserFactory
,
RegistrationFactory
,
UserProfileFactory
from
terrain.factories
import
CourseFactory
,
GroupFactory
import
xmodule.modulestore.django
from
auth.authz
import
get_user_by_email
from
logging
import
getLogger
logger
=
getLogger
(
__name__
)
...
...
@@ -159,9 +162,18 @@ def log_into_studio(
def
create_a_course
():
css_click
(
'a.new-course-button'
)
fill_in_course_info
()
css_click
(
'input.new-course-save'
)
c
=
CourseFactory
.
create
(
org
=
'MITx'
,
course
=
'999'
,
display_name
=
'Robot Super Course'
)
# Add the user to the instructor group of the course
# so they will have the permissions to see it in studio
g
=
GroupFactory
.
create
(
name
=
'instructor_MITx/999/Robot_Super_Course'
)
u
=
get_user_by_email
(
'robot+studio@edx.org'
)
u
.
groups
.
add
(
g
)
u
.
save
()
world
.
browser
.
reload
()
course_link_css
=
'span.class-name'
css_click
(
course_link_css
)
course_title_css
=
'span.course-title'
assert_true
(
world
.
browser
.
is_element_present_by_css
(
course_title_css
,
5
))
...
...
common/djangoapps/terrain/factories.py
View file @
af2690fc
from
student.models
import
User
,
UserProfile
,
Registration
from
django.contrib.auth.models
import
Group
from
datetime
import
datetime
from
factory
import
Factory
from
xmodule.modulestore
import
Location
...
...
@@ -8,6 +9,12 @@ from uuid import uuid4
from
xmodule.timeparse
import
stringify_time
class
GroupFactory
(
Factory
):
FACTORY_FOR
=
Group
name
=
'staff_MITx/999/Robot_Super_Course'
class
UserProfileFactory
(
Factory
):
FACTORY_FOR
=
UserProfile
...
...
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