Commit Graph

708 Commits

Author SHA1 Message Date
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
Douglas Hall
ac390e13f6 Refactored middleware that supports SESSION_COOKIE_DOMAIN overrides. 2016-10-18 09:07:03 -04:00
Nimisha Asthagiri
8b0a26a419 Move sync_user_info management command from common to LMS. 2016-10-06 17:04:49 -04:00
Matjaz Gregoric
8dc84bec3a Enable discussions on CCX courses.
Discussion is restricted to the CCX course (there is no sharing of
discussions with the parent course or other CCX instances).
2016-09-12 09:51:05 +02:00
Toby Lawrence
26891bc0fd Default to not requesting responses when grabbing a single thread.
We're often grabbing the metadata of a specific thread to then be able
to perform other operations, but we never need the actual responses or
comments of a thread unless we're displaying it in the normal forum
view.

This change sets a default of with_responses=False, which instructs the
comment service to not send back the responses/comments for the given
thread.  We only ask for responses in the case of rendering a single
thread or inline discussion.
2016-09-07 23:17:11 -04:00
Andy Armstrong
6c54035197 Add a content header to the discussion board 2016-08-17 16:20:45 -04:00
Andy Armstrong
89f93df46e Refactor out a new discussions Django app 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
cahrens
d061b8ddbe Use request_cache for storing disabled xblock names.
TNL-5002
2016-07-25 16:17:30 -04:00
Matt Drayer
68312bdd2d Revert "Revert "saleem-latif/WL-328: Multi-Site Comprehensive Theming""
2. Update COMPREHNSIVE_THEME_DIR to COMPREHENSIVE_THEME_DIRS
3. Update paver commands to support multi theme dirs
4. Updating template loaders
5. Add ENABLE_COMPREHENSIVE_THEMING flag to enable or disable theming via settings
6. Update tests
7. Add backward compatibility for COMPREHEHNSIVE_THEME_DIR
2016-06-30 15:19:51 +05: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
Nimisha Asthagiri
74a3665289 Update query and mongo counts 2016-06-23 20:22:32 -04:00
David Ormsbee
5f1595910d Merge pull request #12784 from edx/release
Release to Master (2016-06-16 hotfix)
2016-06-16 18:50:18 -04:00
David Ormsbee
255267d42c Create forums config model for adjusting connection timeouts. 2016-06-16 13:50:13 -04: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
c4c4ee31c2 Reset current language after discussion tests, so that other languages don't leak into tests that don't use the LocaleMiddleware 2016-06-08 10:07:49 -04:00
Andy Armstrong
7e2a174eec Move discussion board to the Pattern Library
TNL-4622
2016-06-02 12:48:12 -04:00
wajeeha-khalid
3c0502726c MA-2318: get DiscussionTopic against topic id 2016-06-02 11:33:39 +05:00
Hasnain
11454640da Added middleware to redirect the user from expired course page to all courses page. 2016-06-01 14:56:27 -04:00
Calen Pennington
853bfe7a36 Add a TestCase mixin for enabling caches in tests
By default, disable all caching in tests, to preserve test independence.
In order to enable caching, inherit from CacheSetupMixin, and specify
which cache configuration is needed.

[EV-32]
2016-05-04 14:51:30 -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
Ayub khan
986209669d Revert "SUST-35 Implementation of course_key_from_string_or_404 to return course_key or raise a 404" 2016-04-28 15:50:17 +05:00
John Eskew
0899871958 Merge pull request #11042 from edx/jeskew/xml_removal
Remove XML modulestore code from most tests.
2016-04-27 11:20:02 -04:00
Ayub khan
0becea942f Merge pull request #12144 from Ayub-Khan/SUST-35-course_key_from_string_or_404
SUST-35 Implementation of course_key_from_string_or_404 to return course_key or raise a 404
2016-04-19 18:44:13 +05:00
Ayub-khan
9e3f68c0a0 -Addressed wrong course id comment. 2016-04-18 12:03:46 +05:00
Ayub-khan
ef70d017c8 -fixed failing tests
-Adressed all comments
2016-04-15 15:40:21 +05:00
Ayub-khan
d8464dbfb0 -changed method name from "from_string_or_404" to "course_key_from_string_or_404".
-Updated method "course_key_from_string_or_404" to raise message too.
-Wrote tests for "course_key_from_string_or_404" when exception message is given.
-Modified existing methods to use "ddt.data".
-Used Splunk logs to find exectly where we were getting "Invalid Key Error"
-Updated Views where we were getting "Invalid Key Error" in splunk logs.
-Wrote tests for those View End points where we were getting "Invalid Key Error"
2016-04-14 15:57:39 +05:00
wajeeha-khalid
5b5fb2464d TNL-3818: fixed recent activity mapping in thread-list sort for Forums Web 2016-04-13 17:47:31 +05: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
Ned Batchelder
2e1238b83e Remove unused imports 2016-04-08 11:23:05 -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
cahrens
db3596546e Delete out-of-date test.
TNL-4284
2016-03-28 14:53:38 -04:00
Ben Patterson
c504029b39 Create a third shard for lms unit tests.
This will leverage the nose attrib plugin to allow us
to break tests apart on our build system to run
in parallel on separate nodes.
2016-03-17 12:01:42 -04:00
Renzo Lucioni
1f0e61baa9 Speed up comment client tests
Also accelerates forums UnicodeTestCases
2016-03-01 14:41:52 -05:00
wajeeha-khalid
9d6df1e132 Merge pull request #11189 from edx/ekafeel/discussion-api-namespace-pagination
Ekafeel/discussion api namespace pagination
2016-02-09 17:42:48 +05:00
M. Rehan
b427da7185 Merge pull request #11350 from edx/mrehan/unwanted-discussion-modules
Fix - skip orphans while getting discussion modules
2016-01-29 12:46:02 +05:00
M. Rehan
31b180beb3 Skip orphans while getting discussion modules 2016-01-29 11:09:00 +05:00
wajeeha-khalid
e723fb6aec MA-1930 add result count in paginated endpoints 2016-01-28 13:41:27 +05:00
Giovanni Di Milia
e63194c1cd Added CCX REST APIs
CCX REST APIs
OAUTH2 authorization for CCX APIs
- oauth2 authorization required for ccx list.
- Course-instructor permission for ccx api endpoint
- Protection for detail view too.

Tests for CCX REST APIs and OAUTH2 authorization
2016-01-27 11:04:28 -05:00
Christine Lytwynec
76c8e33d49 Fix file upload in IE 2016-01-15 14:54:54 -05:00
Nimisha Asthagiri
c14c146d0e Merge pull request #10841 from edx/mobile/optimize-course-api
Optimize Course Catalog using CourseOverview
2015-12-11 10:03:35 -05:00
Nimisha Asthagiri
2b8441a072 Update Course Catalog to use CourseOverview 2015-12-10 20:37:50 -05:00
Ned Batchelder
43ac38aa87 Add autospec to all mocks 2015-12-09 09:44:22 -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
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00