1. 02 Dec, 2015 1 commit
    • CohortMembership Test Fixes · 88a38965
      There are 3 main changes in this commit:
      * CohortFactory now sets up memberships properly, so consuming tests do not
      need to explicitly touch CourseUserGroup.users to add() users.
      * test_get_cohort_sql_queries has been updated to 3 and 9 queries when using
      and not using the cache, respectively. This is needed due to each operation
      needing an extra queery to get the CourseUserGroup from the CohortMembership.
      * Adding remove_user_from_cohort(), the counterpart to add_user_to_cohort().
      This is also to keep tests from touching the users field directly, and keep
      CohortMembership data in sync.
      Eric Fischer committed
  2. 28 Aug, 2015 1 commit
  3. 13 May, 2015 1 commit
  4. 12 May, 2015 1 commit
  5. 09 Mar, 2015 1 commit
  6. 05 Mar, 2015 1 commit
  7. 25 Feb, 2015 1 commit
  8. 04 Feb, 2015 1 commit
    • Better support specifying of modulestore configuration in test cases · b353ed2e
      The existing pattern of using `override_settings(MODULESTORE=...)` prevented
      us from having more than one layer of subclassing in modulestore tests.
      
      In a structure like:
      
          @override_settings(MODULESTORE=store_a)
          class BaseTestCase(ModuleStoreTestCase):
              def setUp(self):
                  # use store
      
          @override_settings(MODULESTORE=store_b)
          class ChildTestCase(BaseTestCase):
              def setUp(self):
                  # use store
      
      In this case, the store actions performed in `BaseTestCase` on behalf of
      `ChildTestCase` would still use `store_a`, even though the `ChildTestCase`
      had specified to use `store_b`. This is because the `override_settings`
      decorator would be the innermost wrapper around the `BaseTestCase.setUp` method,
      no matter what `ChildTestCase` does.
      
      To remedy this, we move the call to `override_settings` into the
      `ModuleStoreTestCase.setUp` method, and use a cleanup to remove the override.
      Subclasses can just defined the `MODULESTORE` class attribute to specify which
      modulestore to use _for the entire `setUp` chain_.
      
      [PLAT-419]
      Calen Pennington committed
  9. 05 Dec, 2014 2 commits
  10. 02 Dec, 2014 1 commit
  11. 10 Nov, 2014 1 commit
  12. 10 Sep, 2014 1 commit
  13. 03 Sep, 2014 1 commit