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
d552eef9
Commit
d552eef9
authored
Jul 01, 2013
by
jnater
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #316 from edx/jnater/pep8_fixes
Removed some pep8 violations.
parents
6f8a3120
5cb4c1a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
16 deletions
+4
-16
common/djangoapps/course_groups/tests/tests.py
+2
-11
lms/djangoapps/courseware/tests/test_views.py
+2
-3
lms/djangoapps/instructor/tests/test_enrollment.py
+0
-2
No files found.
common/djangoapps/course_groups/tests/tests.py
View file @
d552eef9
...
...
@@ -23,7 +23,6 @@ TEST_DATA_XML_MODULESTORE = xml_store_config(TEST_DATA_DIR)
@override_settings
(
MODULESTORE
=
TEST_DATA_XML_MODULESTORE
)
class
TestCohorts
(
django
.
test
.
TestCase
):
@staticmethod
def
topic_name_to_id
(
course
,
name
):
"""
...
...
@@ -34,7 +33,6 @@ class TestCohorts(django.test.TestCase):
run
=
course
.
url_name
,
name
=
name
)
@staticmethod
def
config_course_cohorts
(
course
,
discussions
,
cohorted
,
...
...
@@ -80,7 +78,6 @@ class TestCohorts(django.test.TestCase):
course
.
cohort_config
=
d
def
setUp
(
self
):
"""
Make sure that course is reloaded every time--clear out the modulestore.
...
...
@@ -89,7 +86,6 @@ class TestCohorts(django.test.TestCase):
# to course. We don't have a course.clone() method.
_MODULESTORES
.
clear
()
def
test_get_cohort
(
self
):
"""
Make sure get_cohort() does the right thing when the course is cohorted
...
...
@@ -105,7 +101,7 @@ class TestCohorts(django.test.TestCase):
cohort
=
CourseUserGroup
.
objects
.
create
(
name
=
"TestCohort"
,
course_id
=
course
.
id
,
group_type
=
CourseUserGroup
.
COHORT
)
group_type
=
CourseUserGroup
.
COHORT
)
cohort
.
users
.
add
(
user
)
...
...
@@ -135,7 +131,7 @@ class TestCohorts(django.test.TestCase):
cohort
=
CourseUserGroup
.
objects
.
create
(
name
=
"TestCohort"
,
course_id
=
course
.
id
,
group_type
=
CourseUserGroup
.
COHORT
)
group_type
=
CourseUserGroup
.
COHORT
)
# user1 manually added to a cohort
cohort
.
users
.
add
(
user1
)
...
...
@@ -169,7 +165,6 @@ class TestCohorts(django.test.TestCase):
self
.
assertEquals
(
get_cohort
(
user2
,
course
.
id
)
.
name
,
"AutoGroup"
,
"user2 should still be in originally placed cohort"
)
def
test_auto_cohorting_randomization
(
self
):
"""
Make sure get_cohort() randomizes properly.
...
...
@@ -199,8 +194,6 @@ class TestCohorts(django.test.TestCase):
self
.
assertGreater
(
num_users
,
1
)
self
.
assertLess
(
num_users
,
50
)
def
test_get_course_cohorts
(
self
):
course1_id
=
'a/b/c'
course2_id
=
'e/f/g'
...
...
@@ -214,14 +207,12 @@ class TestCohorts(django.test.TestCase):
course_id
=
course1_id
,
group_type
=
CourseUserGroup
.
COHORT
)
# second course should have no cohorts
self
.
assertEqual
(
get_course_cohorts
(
course2_id
),
[])
cohorts
=
sorted
([
c
.
name
for
c
in
get_course_cohorts
(
course1_id
)])
self
.
assertEqual
(
cohorts
,
[
'TestCohort'
,
'TestCohort2'
])
def
test_is_commentable_cohorted
(
self
):
course
=
modulestore
()
.
get_course
(
"edX/toy/2012_Fall"
)
self
.
assertFalse
(
course
.
is_cohorted
)
...
...
lms/djangoapps/courseware/tests/test_views.py
View file @
d552eef9
...
...
@@ -3,7 +3,6 @@ import datetime
from
django.test
import
TestCase
from
django.http
import
Http404
from
django.conf
import
settings
from
django.test.utils
import
override_settings
from
django.contrib.auth.models
import
User
from
django.test.client
import
RequestFactory
...
...
@@ -52,8 +51,8 @@ class ViewsTestCase(TestCase):
self
.
date
=
datetime
.
datetime
(
2013
,
1
,
22
,
tzinfo
=
UTC
)
self
.
course_id
=
'edX/toy/2012_Fall'
self
.
enrollment
=
CourseEnrollment
.
objects
.
get_or_create
(
user
=
self
.
user
,
course_id
=
self
.
course_id
,
created
=
self
.
date
)[
0
]
course_id
=
self
.
course_id
,
created
=
self
.
date
)[
0
]
self
.
location
=
[
'tag'
,
'org'
,
'course'
,
'category'
,
'name'
]
self
.
_MODULESTORES
=
{}
# This is a CourseDescriptor object
...
...
lms/djangoapps/instructor/tests/test_enrollment.py
View file @
d552eef9
...
...
@@ -6,10 +6,8 @@ Unit tests for enrollment methods in views.py
from
django.test.utils
import
override_settings
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
courseware.access
import
_course_staff_group_name
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
courseware.tests.modulestore_config
import
TEST_DATA_MONGO_MODULESTORE
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
,
AdminFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
...
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