Commit d552eef9 by jnater

Merge pull request #316 from edx/jnater/pep8_fixes

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