Commit Graph

141 Commits

Author SHA1 Message Date
Jeremy Bowman
5289c7e828 PLAT-1915 Stop using deprecated BaseException.message 2018-01-31 17:22:01 -05:00
Jeremy Bowman
ebc54c8f1a PLAT-1890 Fixed assorted ModifyingEnforceTypeWarning warnings 2018-01-24 11:49:42 -05:00
Jeremy Bowman
669aa13ad6 PLAT-1873 to_deprecated_string() cleanup part 2 2018-01-08 17:26:55 -05:00
bmedx
5fbbf4979a Tag LMS Unit 1 tests that fail in Django 1.11 2017-11-22 15:46:45 -05:00
Ned Batchelder
e23e3a0486 Fix a number of unused-import pylint violations 2017-11-21 19:57:06 -05:00
John Eskew
f5f6b08884 Add missing 'later' variable. 2017-10-05 11:12:54 -04:00
John Eskew
7dfb6cc681 Change all UTC timezones to import from pytz instead of Django. 2017-10-05 11:12:52 -04:00
Jeremy Bowman
ca97e946a6 Switch to pytest for unit tests 2017-09-22 16:07:53 -04:00
cahrens
21bcf02d97 Remove unneeded mustache references. 2017-07-11 12:06:27 -04:00
Sofiya Semenova
f0c694e562 Review round 1 2017-07-10 14:58:27 +00:00
Sofiya Semenova
f111655484 Test 2017-07-07 14:37:54 +00:00
Albert St. Aubin
6cdcf8e9b8 Discussion group moderation 2017-07-06 13:39:03 -04:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
cahrens
3abc7dc07e isort updates 2017-06-05 13:47:48 -04:00
cahrens
36c51450c2 Adds in radio button patch request and text for page
EDUCATOR-229
2017-06-05 13:00:31 -04:00
Albert St. Aubin
c23c0b991b EDUCATOR-141: Moved the Discussions Mgt to its own tab and updated tests 2017-06-05 12:59:51 -04:00
cahrens
8951ac8c61 Refactor server-size code to enable enrollment tracks.
EDUCATOR-11
2017-06-05 12:59:50 -04:00
cahrens
31fbde9c1f Rename cohort methods to divided. 2017-04-27 14:58:08 -04:00
Christina Roberts
5bcf7422d9 Merge pull request #14830 from edx/christina/change-default-cohorting
Change default value for "always_cohort_inline_discussions" to False
2017-04-10 10:04:55 -04:00
cahrens
121078eb67 Change default value for "always cohort".
TNL-6815
2017-04-07 13:02:25 -04:00
attiyaishaque
a7550912f8 TNL-6284 Empty subcategory will not render in inline discussion modules. 2017-04-06 12:00:53 +05:00
rabiaiftikhar
ccfa3ea74d TNl-6610 Fix "more" menu on discussion post for global staff. 2017-03-09 14:16:31 +05:00
Andy Armstrong
248558f1d4 Render Discussion tab using web fragments 2017-02-28 23:39:39 -05:00
David Ormsbee
2051c90924 Test Speedup: Isolate Modulestore Signals
There are a number of Django Signals that are on the modulestore's
SignalHandler class, such as SignalHandler.course_published. These
signals can trigger very expensive processes to occur, such as course
overview or block structures generation. Most of the time, the test
author doesn't care about these side-effects.

This commit does a few things:

* Converts the signals on SignalHandler to be instances of a new
  SwitchedSignal class, that allows signal sending to be disabled.

* Creates a SignalIsolationMixin helper similar in spirit to the
  CacheIsolationMixin, and adds it to the ModuleStoreIsolationMixin
  (and thus to ModuleStoreTestCase and SharedModuleStoreTestCase).

* Converts our various tests to use this new mechanism. In some cases,
  this means adjusting query counts downwards because they no longer
  have to account for publishing listener actions.

Modulestore generated signals are now muted by default during test runs.
Calls to send() them will result in no-ops. You can choose to enable
specific signals for a given subclass of ModuleStoreTestCase or
SharedModuleStoreTestCase by specifying an ENABLED_SIGNALS class
attribute, like the following example:

    from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

    class MyPublishTestCase(ModuleStoreTestCase):
        ENABLED_SIGNALS = ['course_published', 'pre_publish']

You should take great care when disabling signals outside of a
ModuleStoreTestCase or SharedModuleStoreTestCase, since they can leak
out into other tests. Be sure to always clean up, and never disable
signals outside of testing. Because signals are essentially process
globals, it can have a lot of unpleasant side-effects if we start
mucking around with them during live requests.

Overall, this change has cut the total test execution time for
edx-platform by a bit over a third, though we still spend a lot in
pre-test setup during our test builds.

[PERF-413]
2017-02-23 10:31:16 -05:00
attiyaishaque
76e1d4a75c TNL-5621 Fix discussion topics in MIT course. 2016-11-09 22:26:48 +05:00
Toby Lawrence
2acb4a6cad [PERF-386] Utilize ForumsConfig to enable and disable forums.
This specifically enables/disables the underlying comment service client
used to make calls to the service.  When disabled, this client will now
throw an exception which can be propagated upwards so that callers can
make the right decision about how to notify users of the error, or
handle retry, etc etc.
2016-11-03 10:20:19 -04:00
Toby Lawrence
6704e17afd [TNL-5632] Optimize the single_thread view.
Firstly, we're now explicitly instructing the comments service to not
return thread responses/comments if the request isn't AJAX.  So, if you
load the URL for a single discussion thread in your browser, this would
be a non-AJAX call and we'll avoid loading the responses for the entire
thread behind-the-scenes.  Big win here for large threads.

Next, we removed a redundant "get threads" call which was also happening
behind-the-scenes.  This call was redundant as the front-end JS also
grabs the thread list when a topic is chosen, so we were making an
extranenous call for no benefit.  Poof, gone!

Finally, we added some caching of database queries that are required to
drive a lot of the permissions/cohorts machinery around discussion.
This will have a minimal effect but introduced a cleaner way to apply
general memoization at the per-request level which will let us further
cache things as we identify them as issues.
2016-10-18 13:11:30 -04:00
Andy Armstrong
6c54035197 Add a content header to the discussion board 2016-08-17 16:20:45 -04:00
Calen Pennington
bc20a37c2b Simplify how shards are selected in CI 2016-08-03 16:23:02 -04:00
Ned Batchelder
8b1978ba6c Fix unused-import errors 2016-08-03 12:44:41 -04:00
E. Kolpakov
33b3dfcc92 Converts Discussion XModule to Discussion XBlock
* Renames discussion_module to discussion_xblock
* Moves common/lib/xmodule/xmodule_discussion to openedx/core/lib/xblock_builtin/xblock_discussion
2016-06-29 06:47:04 +12:00
Brian Jacobel
b6cf9d231f Disallow reporting and upvoting of your own posts in discussion forums 2016-06-15 12:01:23 -04:00
Calen Pennington
411f1f7964 Use the Django TestClient for forum unit tests, so that middleware is cleaned up properly 2016-06-08 16:43:31 -04:00
Calen Pennington
18e1610043 Remove the create_user argument to setUp.
Instead, use a class attribute to define test behavior. This allows for
easier addition of new mixins over time.
2016-05-04 11:35:55 -04:00
Ben Patterson
b9558a90f1 Create a 3rd explicit shard for unit tests.
More accurately, this creates a 4th shard because the
last shard is always the default.
2016-04-28 10:09:32 -04:00
John Eskew
91c94977d5 Unify usage of a single test mixed modulestore called:
TEST_DATA_MIXED_MODULESTORE
Remove these test mixed modulestores:
TEST_DATA_MIXED_TOY_MODULESTORE
TEST_DATA_MIXED_CLOSED_MODULESTORE
TEST_DATA_MIXED_GRADED_MODULESTORE
2016-04-12 11:53:51 -04:00
John Eskew
47fdc841c0 Import test course instead of using XML-backed course. 2016-04-12 11:53:50 -04:00
John Eskew
3fb437e533 Import test course instead of using XML-backed course. 2016-04-12 11:53:50 -04:00
Renzo Lucioni
0e7247f2a7 Fix discussion category map for self-paced courses
Prevents start date alone from being used to filter out categories in self-paced courses during construction of the category map. ECOM-4017.
2016-04-04 21:15:26 -04:00
M. Rehan
31b180beb3 Skip orphans while getting discussion modules 2016-01-29 11:09:00 +05:00
Eric Fischer
88a389652b CohortMembership Test Fixes
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.
2015-12-02 15:03:52 -05:00
Brian Beggs
141e0a93c7 Merge branch 'master' into dj18-release-merge 2015-11-19 13:36:13 -05:00
Sven Marnach
3dcc3c4aae Clean up occurrences of SlashSeparatedCourseKey in the django_comment_client app.
The preferred form is to use CourseKey.from_string() instead of
SlashSeparatedCourseKey.from_deprecated_string().
2015-11-18 16:37:57 +01:00
Usman Khalid
6cb62f2697 Rebase upgrade Django to v1.8.5
Please note that this is a squshed commit and the work of:
Symbolist, macdiesel, nedbat, doctoryes, muzaffaryousaf and muhammad-ammar
2015-11-10 15:00:19 -05:00
Ned Batchelder
322ca34b20 Remove pylint pragmas from "class Meta"
Also remove useless docstrings where they were added to keep pylint
quiet.
2015-10-21 07:37:00 -04:00
mushtaqali
296f75a07c Add template escaping in forums, progress page and course container TNL-2395, TNL-2394, TNL-2393 2015-10-07 11:20:51 -04:00
Will Daly
8555630df7 Upgrade djangorestframework to v3.1
* Upgrade edx-submissions
* Upgrade edx-ora2
* Upgrade edx-val
* Upgrade edx-proctoring
* Update all edx-platform code that depends on DRF, including:
  - auth_exchange
  - cors_csrf
  - embargo
  - enrollment
  - util
  - commerce
  - course_structure
  - discussion_api
  - mobile_api
  - notifier_api
  - teams
  - credit
  - profile_images
  - user_api
  - lib/api (OAuth2 and pagination)
2015-09-25 12:40:57 -04:00
muhammad-ammar
6a5ce5d544 Upgrade factory_boy
TNL-3179
2015-09-18 18:02:38 +05:00
David Ormsbee
9bac3579c0 Convert CohortedTestCase to use SharedModuleStoreTestCase.
Some low hanging fruit optimization of forums tests.
2015-08-27 20:37:48 -04:00
Peter Fogg
2f7fa6fd8b Enforce discussions permissions in teams UI.
Adds a read-only mode to the discussion module which disables any
controls for updating the discussion (votes, follows, replies,
etc). This mode is enabled for users who are not a member of the team,
and are also not moderators, admins, or community TAs.
2015-08-06 11:15:56 -04:00