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
192b9913
Commit
192b9913
authored
Mar 20, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pylint for lettuce factory refactor.
parent
6048bc28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
15 deletions
+26
-15
common/djangoapps/terrain/browser.py
+10
-4
common/djangoapps/terrain/factories.py
+16
-11
No files found.
common/djangoapps/terrain/browser.py
View file @
192b9913
from
lettuce
import
before
,
after
,
world
from
splinter.browser
import
Browser
from
logging
import
getLogger
import
time
# Let the LMS and CMS do their one-time setup
# For example, setting up mongo caches
...
...
@@ -16,6 +15,9 @@ from django.core.management import call_command
@before.harvest
def
initial_setup
(
server
):
'''
Launch the browser once before executing the tests
'''
# Launch the browser app (choose one of these below)
world
.
browser
=
Browser
(
'chrome'
)
# world.browser = Browser('phantomjs')
...
...
@@ -24,14 +26,18 @@ def initial_setup(server):
@before.each_scenario
def
reset_data
(
scenario
):
# Clean out the django test database defined in the
# envs/acceptance.py file: mitx_all/db/test_mitx.db
'''
Clean out the django test database defined in the
envs/acceptance.py file: mitx_all/db/test_mitx.db
'''
logger
.
debug
(
"Flushing the test database..."
)
call_command
(
'flush'
,
interactive
=
False
)
@after.all
def
teardown_browser
(
total
):
# Quit firefox
'''
Quit the browser after executing the tests
'''
world
.
browser
.
quit
()
pass
common/djangoapps/terrain/factories.py
View file @
192b9913
from
student.tests.factories
import
(
UserFactory
,
UserProfileFactory
,
RegistrationFactory
,
GroupFactory
,
CourseEnrollmentAllowed
,
CourseFactory
,
ItemFactory
)
'''
Factories are defined in other modules and absorbed here into the
lettuce world so that they can be used by both unit tests
and integration / BDD tests.
TODO: move the course and item factories out of student and into
xmodule/modulestore
'''
import
student.tests.factories
as
sf
from
lettuce
import
world
@world.absorb
class
UserFactory
(
UserFactory
):
class
UserFactory
(
sf
.
UserFactory
):
"""
User account for lms / cms
"""
...
...
@@ -14,7 +19,7 @@ class UserFactory(UserFactory):
@world.absorb
class
UserProfileFactory
(
UserProfileFactory
):
class
UserProfileFactory
(
sf
.
UserProfileFactory
):
"""
Demographics etc for the User
"""
...
...
@@ -22,7 +27,7 @@ class UserProfileFactory(UserProfileFactory):
@world.absorb
class
RegistrationFactory
(
RegistrationFactory
):
class
RegistrationFactory
(
sf
.
RegistrationFactory
):
"""
Activation key for registering the user account
"""
...
...
@@ -30,7 +35,7 @@ class RegistrationFactory(RegistrationFactory):
@world.absorb
class
GroupFactory
(
GroupFactory
):
class
GroupFactory
(
sf
.
GroupFactory
):
"""
Groups for user permissions for courses
"""
...
...
@@ -38,7 +43,7 @@ class GroupFactory(GroupFactory):
@world.absorb
class
CourseEnrollmentAllowedFactory
(
CourseEnrollmentAllowed
):
class
CourseEnrollmentAllowedFactory
(
sf
.
CourseEnrollmentAllowed
):
"""
Users allowed to enroll in the course outside of the usual window
"""
...
...
@@ -46,7 +51,7 @@ class CourseEnrollmentAllowedFactory(CourseEnrollmentAllowed):
@world.absorb
class
CourseFactory
(
CourseFactory
):
class
CourseFactory
(
sf
.
CourseFactory
):
"""
Courseware courses
"""
...
...
@@ -54,7 +59,7 @@ class CourseFactory(CourseFactory):
@world.absorb
class
ItemFactory
(
ItemFactory
):
class
ItemFactory
(
sf
.
ItemFactory
):
"""
Everything included inside a course
"""
...
...
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