Commit Graph

243 Commits

Author SHA1 Message Date
Jeremy Bowman
669aa13ad6 PLAT-1873 to_deprecated_string() cleanup part 2 2018-01-08 17:26:55 -05:00
bmedx
d827d47b48 Tag LMS Unit 2 tests that fail in Django 1.11 2017-11-22 15:47:22 -05:00
Ned Batchelder
e23e3a0486 Fix a number of unused-import pylint violations 2017-11-21 19:57:06 -05:00
bmedx
11a4030767 LMS urls cleanup for Django 1.11
- Remove usage of django.urls.patterns
- Change urls tuples to lists
- Make all string view names callables
- This is the second of several urls updates for LMS; a work in progress
2017-11-06 16:06:00 -05:00
Aamish Baloch
7c3dab08a7 YONK-776: added thread_followed and thread_unfollowed signals 2017-10-09 19:14:38 +05:00
Jeremy Bowman
ded294c420 pytest compatibility fixes 2017-09-06 14:20:34 -04:00
Andy Armstrong
0f808cec78 Implement theme admin UI to support previewing
LEARNER-2017
2017-07-27 17:24:31 -04:00
Eric Fischer
d4943c5337 Use bulk_operations when loading items
This has been causing a huge memory leak, wrapping the call in this
context manager properly cleans up the 'records' entries.

EDUCATOR-274
2017-07-25 12:40:15 -04:00
Jesse Shapiro
fa9c09f9fe Remove Enterprise SSO hooks 2017-07-21 18:24:09 -04:00
Andy Armstrong
aeecf34387 Enable conditional pre-start-date access to courses
LEARNER-1854
2017-07-14 14:00:48 -04:00
Kyle McCormick
fade4a10af Implement event for forum thread views
EDUCATOR-341
2017-07-11 12:42:49 -04:00
Andy Armstrong
a815003b3b Handle anonymous and unenrolled users on the new course home page
LEARNER-1696
2017-07-10 17:52:28 -04:00
Albert St. Aubin
6cdcf8e9b8 Discussion group moderation 2017-07-06 13:39:03 -04:00
Uman Shahzad
8b65ca17c5 Migrate to latest, split python-social-auth.
PSA was monolothic, now split, with new features, like
a DB-backed partial pipeline. FB OAuth2 version also upped.

Partial pipelines don't get cleared except when necessary.
They persist for special cases like change of browser while
still mid-pipeline (i.e. email validation step).

Refactor, cleanup, and update of a lot of small things as well.

PLEASE NOTE the new `social_auth_partial` table.
2017-06-20 22:05:36 +05:00
Kyle McCormick
c22aeceab7 Truncate title in thread created event to 1000 chars
EDUCATOR-341
2017-06-20 11:56:53 -04:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Muzaffar yousaf
2f293ccc68 Merge pull request #14901 from OmarIthawi/omar/commentable-id-unicode
Unicode fixes for django_comment_client and request_cached decorator
2017-05-04 15:07:22 +05:00
Calen Pennington
3deb3a3c1b Merge pull request #14977 from cpennington/cale/fix-learner-542
Cale/fix learner 542
2017-05-01 12:18:03 -04:00
Ned Batchelder
ecce0f1513 Merge pull request #14996 from edx/nedbat/remove-useless-super-delegation
Remove a number of unneeded super()-delegation methods
2017-04-28 13:04:43 -04:00
Calen Pennington
1811f7235f Minimize the number of queries done while noop updating a user-preference 2017-04-28 12:26:41 -04:00
cahrens
31fbde9c1f Rename cohort methods to divided. 2017-04-27 14:58:08 -04:00
Ned Batchelder
4a568476fd Remove a number of unneeded super()-delegation methods 2017-04-27 14:12:56 -04:00
Omar Al-Ithawi
0a75f8ece0 Unicode support for request_cached decorator and commentable_id 2017-04-18 11:12:52 +03:00
Andy Armstrong
da1ac4664e Implement common redirect logic for all course tabs
LEARNER-76
2017-04-12 16:05:32 -04: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
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
Douglas Hall
ac390e13f6 Refactored middleware that supports SESSION_COOKIE_DOMAIN overrides. 2016-10-18 09:07:03 -04: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
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
David Ormsbee
255267d42c Create forums config model for adjusting connection timeouts. 2016-06-16 13:50:13 -04: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
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
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
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -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
Sven Marnach
ef563e4285 Add tests for the discussion forum vote events. 2015-11-18 16:22:59 +01:00
Sven Marnach
cf5d276aea Emit events when users vote on forum posts. 2015-11-18 16:21:50 +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