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
00d25b68
Commit
00d25b68
authored
Mar 22, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved modulestore flush code into terrain/course_helpers
parent
a58ae9b6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
37 deletions
+22
-37
cms/djangoapps/contentstore/features/common.py
+1
-18
cms/djangoapps/contentstore/features/courses.py
+1
-1
cms/djangoapps/contentstore/features/studio-overview-togglesection.py
+3
-3
cms/djangoapps/contentstore/features/subsection.py
+1
-1
common/djangoapps/terrain/course_helpers.py
+15
-0
lms/djangoapps/courseware/features/common.py
+1
-14
No files found.
cms/djangoapps/contentstore/features/common.py
View file @
00d25b68
...
...
@@ -43,7 +43,7 @@ def i_press_the_category_delete_icon(step, category):
@step
(
'I have opened a new course in Studio$'
)
def
i_have_opened_a_new_course
(
step
):
clear_courses
()
world
.
clear_courses
()
log_into_studio
()
create_a_course
()
...
...
@@ -69,23 +69,6 @@ def create_studio_user(
user_profile
=
world
.
UserProfileFactory
(
user
=
studio_user
)
def
flush_xmodule_store
():
# Flush and initialize the module store
# It needs the templates because it creates new records
# by cloning from the template.
# Note that if your test module gets in some weird state
# (though it shouldn't), do this manually
# from the bash shell to drop it:
# $ mongo test_xmodule --eval "db.dropDatabase()"
_MODULESTORES
=
{}
modulestore
()
.
collection
.
drop
()
update_templates
()
def
clear_courses
():
flush_xmodule_store
()
def
fill_in_course_info
(
name
=
'Robot Super Course'
,
org
=
'MITx'
,
...
...
cms/djangoapps/contentstore/features/courses.py
View file @
00d25b68
...
...
@@ -6,7 +6,7 @@ from common import *
@step
(
'There are no courses$'
)
def
no_courses
(
step
):
clear_courses
()
world
.
clear_courses
()
@step
(
'I click the New Course button$'
)
...
...
cms/djangoapps/contentstore/features/studio-overview-togglesection.py
View file @
00d25b68
...
...
@@ -8,13 +8,13 @@ logger = getLogger(__name__)
@step
(
u'I have a course with no sections$'
)
def
have_a_course
(
step
):
clear_courses
()
world
.
clear_courses
()
course
=
world
.
CourseFactory
.
create
()
@step
(
u'I have a course with 1 section$'
)
def
have_a_course_with_1_section
(
step
):
clear_courses
()
world
.
clear_courses
()
course
=
world
.
CourseFactory
.
create
()
section
=
world
.
ItemFactory
.
create
(
parent_location
=
course
.
location
)
subsection1
=
world
.
ItemFactory
.
create
(
...
...
@@ -25,7 +25,7 @@ def have_a_course_with_1_section(step):
@step
(
u'I have a course with multiple sections$'
)
def
have_a_course_with_two_sections
(
step
):
clear_courses
()
world
.
clear_courses
()
course
=
world
.
CourseFactory
.
create
()
section
=
world
.
ItemFactory
.
create
(
parent_location
=
course
.
location
)
subsection1
=
world
.
ItemFactory
.
create
(
...
...
cms/djangoapps/contentstore/features/subsection.py
View file @
00d25b68
...
...
@@ -7,7 +7,7 @@ from nose.tools import assert_equal
@step
(
'I have opened a new course section in Studio$'
)
def
i_have_opened_a_new_course_section
(
step
):
clear_courses
()
world
.
clear_courses
()
log_into_studio
()
create_a_course
()
add_section
()
...
...
common/djangoapps/terrain/course_helpers.py
View file @
00d25b68
...
...
@@ -7,6 +7,8 @@ from django.contrib.auth import authenticate, login
from
django.contrib.auth.middleware
import
AuthenticationMiddleware
from
django.contrib.sessions.middleware
import
SessionMiddleware
from
student.models
import
CourseEnrollment
from
xmodule.modulestore.django
import
_MODULESTORES
,
modulestore
from
xmodule.templates
import
update_templates
from
bs4
import
BeautifulSoup
import
os.path
from
urllib
import
quote_plus
...
...
@@ -119,3 +121,16 @@ def save_the_course_content(path='/tmp'):
f
=
open
(
'
%
s/
%
s'
%
(
path
,
filename
),
'w'
)
f
.
write
(
output
)
f
.
close
@world.absorb
def
clear_courses
():
# Flush and initialize the module store
# It needs the templates because it creates new records
# by cloning from the template.
# Note that if your test module gets in some weird state
# (though it shouldn't), do this manually
# from the bash shell to drop it:
# $ mongo test_xmodule --eval "db.dropDatabase()"
_MODULESTORES
=
{}
modulestore
()
.
collection
.
drop
()
update_templates
()
lms/djangoapps/courseware/features/common.py
View file @
00d25b68
...
...
@@ -24,7 +24,7 @@ def create_course(step, course):
# First clear the modulestore so we don't try to recreate
# the same course twice
# This also ensures that the necessary templates are loaded
flush_xmodule_store
()
world
.
clear_courses
()
# Create the course
# We always use the same org and display name,
...
...
@@ -65,19 +65,6 @@ def add_tab_to_course(step, course, extra_tab_name):
display_name
=
str
(
extra_tab_name
))
def
flush_xmodule_store
():
# Flush and initialize the module store
# It needs the templates because it creates new records
# by cloning from the template.
# Note that if your test module gets in some weird state
# (though it shouldn't), do this manually
# from the bash shell to drop it:
# $ mongo test_xmodule --eval "db.dropDatabase()"
_MODULESTORES
=
{}
modulestore
()
.
collection
.
drop
()
update_templates
()
def
course_id
(
course_num
):
return
"
%
s/
%
s/
%
s"
%
(
TEST_COURSE_ORG
,
course_num
,
TEST_COURSE_NAME
.
replace
(
" "
,
"_"
))
...
...
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