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
f7f6ac15
Commit
f7f6ac15
authored
Jun 21, 2017
by
Alex Dusenbery
Committed by
Alex Dusenbery
Jun 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have TestWelcomeMessageView runs succeed deterministically when test order is shuffled.
parent
b1e3a454
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
19 deletions
+11
-19
openedx/features/course_experience/tests/views/test_welcome_message.py
+11
-19
No files found.
openedx/features/course_experience/tests/views/test_welcome_message.py
View file @
f7f6ac15
...
...
@@ -6,7 +6,7 @@ from django.core.urlresolvers import reverse
from
student.models
import
CourseEnrollment
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
Shared
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
.test_course_updates
import
create_course_update
,
remove_course_updates
...
...
@@ -27,32 +27,24 @@ def welcome_message_url(course):
)
class
TestWelcomeMessageView
(
Shared
ModuleStoreTestCase
):
class
TestWelcomeMessageView
(
ModuleStoreTestCase
):
"""
Tests for the course welcome message fragment view.
"""
@classmethod
def
setUpClass
(
cls
):
"""Set up the simplest course possible."""
# setUpClassAndTestData() already calls setUpClass on SharedModuleStoreTestCase
# pylint: disable=super-method-not-called
with
super
(
TestWelcomeMessageView
,
cls
)
.
setUpClassAndTestData
():
with
cls
.
store
.
default_store
(
ModuleStoreEnum
.
Type
.
split
):
cls
.
course
=
CourseFactory
.
create
()
with
cls
.
store
.
bulk_operations
(
cls
.
course
.
id
):
def
setUp
(
self
):
"""Set up the simplest course possible, then set up and enroll our fake user in the course."""
super
(
TestWelcomeMessageView
,
self
)
.
setUp
()
with
self
.
store
.
default_store
(
ModuleStoreEnum
.
Type
.
split
):
self
.
course
=
CourseFactory
.
create
()
with
self
.
store
.
bulk_operations
(
self
.
course
.
id
):
# Create a basic course structure
chapter
=
ItemFactory
.
create
(
category
=
'chapter'
,
parent_location
=
cls
.
course
.
location
)
chapter
=
ItemFactory
.
create
(
category
=
'chapter'
,
parent_location
=
self
.
course
.
location
)
section
=
ItemFactory
.
create
(
category
=
'sequential'
,
parent_location
=
chapter
.
location
)
ItemFactory
.
create
(
category
=
'vertical'
,
parent_location
=
section
.
location
)
@classmethod
def
setUpTestData
(
cls
):
"""Set up and enroll our fake user in the course."""
cls
.
user
=
UserFactory
(
password
=
TEST_PASSWORD
)
CourseEnrollment
.
enroll
(
cls
.
user
,
cls
.
course
.
id
)
self
.
user
=
UserFactory
(
password
=
TEST_PASSWORD
)
CourseEnrollment
.
enroll
(
self
.
user
,
self
.
course
.
id
)
def
setUp
(
self
):
super
(
TestWelcomeMessageView
,
self
)
.
setUp
()
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
TEST_PASSWORD
)
def
tearDown
(
self
):
...
...
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