Commit Graph

165 Commits

Author SHA1 Message Date
Calen Pennington
b353ed2ea2 Better support specifying of modulestore configuration in test cases
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]
2015-02-04 09:09:14 -05:00
Calen Pennington
03a05fd9d4 Always call super(..).setUp() from setUp 2015-02-04 09:09:14 -05:00
David Baumgold
36e77c7463 Fixing pep8 issues 2014-12-11 13:04:49 -05:00
Daniel Friedman
3d91f43030 Support cohorting students via a CSV File.
TNL-735
2014-12-10 09:23:04 -05:00
Jesse Zoldak
bf3b87bc64 Clean up all modulestore testcases
Move modulestore config for tests to an importable location
Disable pylnt warning for lms imports in common tests
Refactor all testcases that loaded all xml courses
TE-610
TE-489
2014-12-02 07:09:36 -05:00
Sarina Canelake
20e2ee9a57 s/pylint: disable=E0611/pylint: disable=no-name-in-module/ 2014-12-01 11:22:09 -05:00
Sarina Canelake
e0f1d3f3f3 s/pylint: disable=C0111/pylint: disable=missing-docstring/ 2014-12-01 11:22:09 -05:00
stv
74f61875c7 Fix PEP8: W601 .has_key() is deprecated, use 'in' 2014-11-25 10:16:05 -05:00
muhammad-ammar
fcaa783e43 Unit Test Improvements
TE-489
2014-10-31 11:55:13 +00:00
Nimisha Asthagiri
d7f850a764 Merge branch 'release'
Conflicts:
	lms/djangoapps/instructor/features/data_download.py
2014-10-07 16:23:28 -04:00
polesye
f039341d21 TNL-549: Fix thread editing. 2014-10-03 23:27:15 +03:00
jmclaus
c2716d470c TNL-172: Change type of a previously posted post. IMPORTANT: this commit depends on commit 774887b in cs_comments_service. 2014-10-03 18:29:25 +02:00
polesye
00c7e60e07 TNL-171: Change topic of a previously posted post. 2014-09-24 20:28:14 +03:00
jsa
d3d4d33064 Ensure group info is present in LMS responses.
TNL-24
2014-09-12 13:47:05 -04:00
Daniel Friedman
4d9517b456 Ensure LMS passes correct group_id when querying content 2014-09-10 16:43:06 -04:00
Waqas Khalid
ac2436f520 User can flag the post whether thread is closed or open
When the thread is closed user can't able to report
the thread and it gives the error. User can now report
thread even it is closed.

TNL-151
2014-09-05 20:58:10 +05:00
Andy Armstrong
8349dbfa42 Implement forum cohort visibility labels correctly
TNL-25
2014-09-04 13:47:48 -04:00
Daniel Friedman
25cbda6638 Test passing group_id in thread creation 2014-09-03 18:14:37 -04:00
Greg Price
ec482c0dc2 Allow authors of forum questions to mark answers
Co-authored-by: jsa <jsa@edx.org>
2014-08-29 15:59:32 -04:00
Greg Price
c23a27bac4 Add post type control to forum new post form
Also change server to pass post type through to the comments service.
2014-08-29 15:59:32 -04:00
Greg Price
182ae7aeb0 Add endorsement info to marked answers in forum
Co-authored-by: jsa <jsa@edx.org>
2014-08-29 15:59:31 -04:00
stv
510c130c1a Fix incorrect max upload file size on forums
The file size is calculated and displayed as a number of bytes, but was
being incorrectly labeled as 'K' [0].

The size is now correctly labeled as "bytes" and the sentence now begins
with a leading captial letter.

Impact: This has been broken on master since 2012 [1].

[0] https://github.com/edx/edx-platform/blob/master/lms/djangoapps/django_comment_client/settings.py#L4
[1] 5d90366917
2014-07-29 12:18:22 -07:00
Nimisha Asthagiri
ea32529866 Fix all modulestore calls to pass in user ids. 2014-07-09 21:10:12 -04:00
jsa
c2ebfde429 implement forums endpoint for searching users 2014-06-16 10:12:52 -04:00
Calen Pennington
cfcbdc0145 Move to OpaqueKey implementations from the external library
[LMS-2757]
2014-05-29 17:03:35 -04:00
Calen Pennington
5c345b3b00 Fix more broken tests after merge from master 2014-05-13 16:21:18 -04:00
Calen Pennington
6c546fbf1f Fix merge conflicts 2014-05-13 15:31:40 -04:00
Calen Pennington
240d91daeb Merge remote-tracking branch 'edx/master' into opaque-keys-merge-master
Conflicts:
	cms/djangoapps/contentstore/management/commands/tests/test_import.py
	cms/djangoapps/contentstore/tests/test_import.py
	common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
	common/lib/xmodule/xmodule/modulestore/xml_importer.py
	lms/djangoapps/bulk_email/tests/test_course_optout.py
	lms/djangoapps/bulk_email/tests/test_email.py
	lms/djangoapps/bulk_email/tests/test_err_handling.py
	lms/djangoapps/class_dashboard/tests/test_dashboard_data.py
	lms/djangoapps/courseware/courses.py
	lms/djangoapps/django_comment_client/base/views.py
	lms/djangoapps/instructor/tests/test_email.py
	lms/djangoapps/instructor/tests/test_legacy_anon_csv.py
	lms/djangoapps/instructor/tests/test_legacy_download_csv.py
	lms/djangoapps/instructor/tests/test_legacy_email.py
	lms/djangoapps/instructor/tests/test_legacy_enrollment.py
	lms/djangoapps/instructor/tests/test_legacy_forum_admin.py
	lms/djangoapps/instructor/tests/test_legacy_gradebook.py
	lms/djangoapps/instructor/tests/test_legacy_raw_download_csv.py
	lms/djangoapps/instructor/tests/test_legacy_reset.py
	lms/djangoapps/instructor/views/api.py
	lms/djangoapps/instructor/views/instructor_dashboard.py
	lms/djangoapps/instructor/views/legacy.py
	lms/templates/courseware/instructor_dashboard.html
2014-05-13 15:30:56 -04:00
Julia Hansbrough
f6f802f3db Pass deprecated course keys through 2014-05-12 18:35:40 +00:00
Greg Price
57f14bded1 Allow extra fields returned from comments service
Previously, an error was raised if the comments service returned data
including an unexpected field, which unnecessarily complicated the
release path for new features, since the list of allowed fields would
need to be modified before cs_comments_service could be modified, and
only then could edx-platform take advantage of the new CS feature. We
still log a warning if an unexpected field is returned, so we will
still be able to tell if the CS returns a corrupt response.

JIRA: FOR-180
2014-05-12 13:49:24 -04:00
Calen Pennington
cd746bf8e5 Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit adds the non-courseware lms/djangoapps and lms/lib.

These keys are now objects with a limited interface, and the particular
internal representation is managed by the data storage layer (the
modulestore).

For the LMS, there should be no outward-facing changes to the system.
The keys are, for now, a change to internal representation only. For
Studio, the new serialized form of the keys is used in urls, to allow
for further migration in the future.

Co-Author: Andy Armstrong <andya@edx.org>
Co-Author: Christina Roberts <christina@edx.org>
Co-Author: David Baumgold <db@edx.org>
Co-Author: Diana Huang <dkh@edx.org>
Co-Author: Don Mitchell <dmitchell@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Nimisha Asthagiri <nasthagiri@edx.org>
Co-Author: Sarina Canelake <sarina@edx.org>

[LMS-2370]
2014-05-08 12:09:23 -04:00
Calen Pennington
ec1b056d82 Use requests library utility method for getting json results 2014-03-28 11:37:43 -04:00
Calen Pennington
d4db0ee7e4 Remove unused methods from comment_client 2014-03-28 11:37:43 -04:00
Greg Price
f56de914d5 Do not allow students to pin/unpin forum threads
The wrong permission was being checked for pinning/unpinning, so a
sufficiently clever student could pin and unpin threads.

JIRA: FOR-499
2014-03-12 17:58:31 -04:00
jsa
4c5336e809 django_comment_client: add unit test for (sub)comment deletion.
JIRA: FOR-470
2014-02-20 13:35:26 -05:00
Greg Price
c321ce50f6 Add unit test for updating forum comment 2014-02-18 17:37:03 -05:00
Greg Price
9ae6bb0b73 Check for forum data errors in LMS
Some messages generated by the comments service are not readily
translated because they come from third-party libraries. Thus, we plan
to try to avoid showing any comments service generated message to the
user. This check preempts the only end-user-visible CS-generated error
message that we are presently aware of.
2014-02-13 15:44:57 -05:00
Greg Price
5841d460f0 Clean up usage of CS API key 2014-02-12 15:24:30 -05:00
Ned Batchelder
1bd213beba Remove unused imports. 2014-02-10 14:07:50 -05:00
jsa
dfa4a03daa i18n: externalize strings in discussion forums templates and python code.
JIRA: FOR-398, FOR-399
2014-01-15 14:26:22 -05:00
Greg Price
5b2ff9b21a Add unit tests for non-ASCII forum content 2014-01-14 13:56:36 -05:00
Greg Price
a1dc49cc9b Remove defunct forum post tagging code 2014-01-14 13:03:56 -05:00
Greg Price
c44e527615 Remove unused forums-related cruft 2014-01-06 16:59:30 -05:00
Greg Price
cec58f885b Remove forum user profile moderator toggle button
This button has been broken for at least a year, so the code has
suffered from bit rot and should be reimplmemented if the feature is
necessary in the short term (which is unlikely since it has been broken
for so long).
2013-12-09 10:23:21 -05:00
David Baumgold
f3f4af8087 settings.MITX_FEATURES => settings.FEATURES 2013-12-03 15:34:55 -05:00
David Baumgold
8eff442752 mitxmako => edxmako 2013-12-03 14:15:09 -05:00
Calen Pennington
da26ae2529 Remove lms/lib from sys.path in favore of using it as the module lms.lib 2013-11-08 11:08:48 -05:00
Greg Price
e6ecb6ecfe Improve performance of forum views
Avoid recomputing course module information for every thread, which
should dramatically improve the performance of high-percentile latency
queries.

JIRA: FOR-250
2013-10-28 13:04:52 -04:00
Greg Price
bd477581b6 Log all comments service requests
Logging the duration of each request will allow us to determine
whether there is a significant difference in the latency reported by
the comments service and that observed by the LMS. Each request will
be assigned a unique identifier to allow correlation of the reported
latency on each end.
2013-10-16 16:31:59 -04:00
Greg Price
62cc9e77bf Use HTTP header for comments service auth
Previously, authentication was done using a URL parameter, which would
appear in various logs. Now, authentication is done more appropriately
with an HTTP header. Note that this requires cs_comments_service commit
cf39aabdd160176ebf206ca19d3ee030161a0b47 or later.
2013-10-11 12:01:44 -04:00