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
e512a506
Commit
e512a506
authored
Nov 23, 2015
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use helper method for generating unique user identities.
parent
bed5d3e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
common/test/acceptance/tests/discussion/test_cohort_management.py
+9
-6
No files found.
common/test/acceptance/tests/discussion/test_cohort_management.py
View file @
e512a506
...
...
@@ -41,8 +41,7 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin
self
.
manual_cohort_id
=
self
.
add_manual_cohort
(
self
.
course_fixture
,
self
.
manual_cohort_name
)
# create a non-instructor who will be registered for the course and in the manual cohort.
self
.
student_name
=
"student_"
+
str
(
uuid
.
uuid4
()
.
hex
)[:
12
]
self
.
student_email
=
self
.
student_name
+
"@example.com"
self
.
student_name
,
self
.
student_email
=
self
.
_generate_unique_user_data
()
self
.
student_id
=
AutoAuthPage
(
self
.
browser
,
username
=
self
.
student_name
,
email
=
self
.
student_email
,
course_id
=
self
.
course_id
,
staff
=
False
...
...
@@ -50,16 +49,14 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin
self
.
add_user_to_cohort
(
self
.
course_fixture
,
self
.
student_name
,
self
.
manual_cohort_id
)
# create a second student user
self
.
other_student_name
=
"other_"
+
str
(
uuid
.
uuid4
()
.
hex
)[:
12
]
self
.
other_student_email
=
self
.
other_student_name
+
"@example.com"
self
.
other_student_name
,
self
.
other_student_email
=
self
.
_generate_unique_user_data
()
self
.
other_student_id
=
AutoAuthPage
(
self
.
browser
,
username
=
self
.
other_student_name
,
email
=
self
.
other_student_email
,
course_id
=
self
.
course_id
,
staff
=
False
)
.
visit
()
.
get_user_id
()
# login as an instructor
self
.
instructor_name
=
"instructor_"
+
str
(
uuid
.
uuid4
()
.
hex
)[:
12
]
self
.
instructor_email
=
self
.
instructor_name
+
"@example.com"
self
.
instructor_name
,
self
.
instructor_email
=
self
.
_generate_unique_user_data
()
self
.
instructor_id
=
AutoAuthPage
(
self
.
browser
,
username
=
self
.
instructor_name
,
email
=
self
.
instructor_email
,
course_id
=
self
.
course_id
,
staff
=
True
...
...
@@ -331,6 +328,12 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin
writer
.
writerow
(
line
)
self
.
addCleanup
(
os
.
remove
,
filename
)
def
_generate_unique_user_data
(
self
):
unique_username
=
'user'
+
str
(
uuid
.
uuid4
()
.
hex
)[:
12
]
unique_email
=
unique_username
+
"@example.com"
return
unique_username
,
unique_email
def
test_add_new_cohort
(
self
):
"""
Scenario: A new manual cohort can be created, and a student assigned to it.
...
...
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