Commit 192b9913 by Jay Zoldak

Pylint for lettuce factory refactor.

parent 6048bc28
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
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
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment