Commit Graph

574 Commits

Author SHA1 Message Date
Ned Batchelder
78e9445aa1 Add super() calls to setUp/tearDown that are missing them
Also, I replaced a number of tearDown methods with addCleanup instead.
And also remove some unneeded patch.stopall() calls.
2015-05-14 18:14:21 -04:00
Christine Lytwynec
ddb1ae667e Split lms unittests into multiple shards 2015-05-07 09:17:26 -04:00
Carlos de la Guardia
f9351ef830 MIT: CCX. Code Quality Fixes
Remove duplicated course listings template code on the student dashboard.
2015-04-10 23:30:27 -04:00
cewing
8ba74429b1 MIT: CCX. Fixes for API changes that affect the binding of descriptors to student context.
fix for making sure all descriptor fields are always available for course descriptors despite module_class tricks

add required fields to cache data for tests

use a different strategy to mock up the get_children method
2015-04-10 23:30:27 -04:00
Carlos de la Guardia
b3da2a54bb MIT: CCX. Fix issues identified in code review
Original Commit Messages:

use edx's own get_parent method, rather than our own.

add field to unique constraint to avoid MultipleObjectsReturned in case of multiple browser clicks on submit

fix 0011 migration, inherit from TimeStampedField and add composite index (migration only)

fix bug where adding an already registered user to a ccx would cause a crash due to an undefined variable

add assertNumQueries tests to test modules where override field providers are used

remove unnecessary teardown

implement recommended style for checking empty list

import utility methods rather than use duplicate code

added comment explaining date conversion to string for json

add logging for invalid users or emails when enrolling students

add comment about xmodule user state

avoid using get_or_create, which seems to be causing a race condition on schedule change save

relocate badly placed edvent handlers to fix multiple submit problem
2015-04-10 23:30:26 -04:00
Chris Rossi
3256eb1ff6 Architecture for arbitrary field overrides, field overrides for
individual students, and a reimplementation of the individual due date
feature.

This work introduces an architecture, used with the 'authored_data'
portion of LmsFieldData, which allows arbitrary field overrides to be
made for fields that are part of the course content or settings (Mongo
data).  The basic architecture is extensible by means of writing and
configuring arbitrary field override providers.

One concrete implementation of a field override provider is provided
which allows for overrides to be for individual students.  This provider
is then used as a basis for reimplementing the individual due date
extensions feature as a proof of concept for the design.

One can imagine writing override providers that provide overrides based
on a student's membership in a cohort or other similar idea.  This work
is being done, in fact, to pave the way for the Personal Online Courses
feature being developed by MIT, which will use an override provider very
much long those lines.
2015-04-06 13:04:44 -07:00
Usman Khalid
d59be9949e Use cohort settings from CourseCohortSettings.
TNL-1258
2015-03-23 09:43:00 +05:00
Ned Batchelder
6ac1b82bb2 Merge pull request #7356 from edx/ned/fix-or-remove-teardown
Fix or remove tearDown methods that don't use super.
2015-03-18 17:36:17 -04:00
Ned Batchelder
425b766965 Remove TEST_DATA_MOCK_MODULESTORE 2015-03-17 17:21:52 -04:00
Ned Batchelder
81d17c516e Fix or remove tearDown methods that don't use super.
Update edx-lint to the version that checks if tearDown uses super.

Convert a number of tearDown methods into addCleanup.

Remove some unneeded tearDown methods: no need to call patch.stopall if
none of them were started with patch.start.
2015-03-17 15:14:52 -04:00
Ned Batchelder
7d799e34f3 Remove unused imports 2015-03-17 07:10:31 -04:00
Ned Batchelder
3acf503e2b Merge pull request #7376 from edx/ned/fix-test-instructor-dashboard
Fix test_instructor_dashboard.py tests
2015-03-17 06:50:06 -04:00
Andy Armstrong
37dd0ec840 Merge pull request #7327 from edx/andya/preferences-api
Implement full preferences API
2015-03-17 00:57:01 -04:00
Andy Armstrong
6976a33a85 Add the preferences endpoint to the User API
TNL-1493

See https://openedx.atlassian.net/wiki/display/TNL/User+API for details
2015-03-16 23:34:35 -04:00
Ned Batchelder
85d0a45b14 Fix test_instructor_dashboard.py tests
This file was never run, because of a missing __init__.py.  It needs a
super() call to make the ModuleStoreTestCase work properly.

Then one test failed, because of a missed change from dollar to
configurable currency.
2015-03-16 15:34:22 -04:00
stv
f03b943b95 Fix Pylint: W0612(unused-variable) 2015-03-13 20:20:05 -07:00
Will Daly
940f892290 ECOM-1140: Instructor dashboard example certificates
Allow global staff to generate example certificates
on the instructor dashboard.

Allow global staff to enable/disable self-generated
certificates for a course.
2015-03-06 13:20:48 -05:00
Zia Fazal
e21ff20375 backend changes based on feedback
Conflicts:
	lms/djangoapps/courseware/courses.py
	lms/djangoapps/instructor_task/api.py

refined entrance exam student attempts reset

Quality improvements 1/16

added rescore, delete state and task history functionality

added unit tests for entrance exam reset attempts

added unit tests for re scoring of entrance exam and task history

improved test coverage

Got rid of pep violation

feedback changes and added jasmine test

added more jasmine tests for Javascript changes

added bok-choy tests for UI changes

replaced input containing <p> tags with <label>

Removed ee element assertions to avoid js error

Added call to super.setUp()

changes based on feedback on 2/18

Writing tests in JS instead of coffee script

commit related to skip entrance exam 2/13

fixed bad-continuation quality error

fixed broken bok-choy test

changes based on feedback on 2/18

added js tests and removed coffee script tests

fixed broken bok-choy and unit tests

changes left while rebasing

rephrase test titles

do not need these libs

changes based on feedback on 2/24

changes text which was left

Changes based on feedback on 3/3
2015-03-04 15:32:56 +05:00
Zia Fazal
b3f85e1d4a Instructor Dashboard management tools for Entrance Exams
Conflicts:
	lms/djangoapps/courseware/courses.py
	lms/djangoapps/instructor_task/api.py

refined entrance exam student attempts reset
added rescore, delete state and task history functionality
2015-02-23 15:04:05 -05:00
Calen Pennington
2bb1aafaaf Merge pull request #6752 from cpennington/modulestore-test-case-cleanup
Clean up ModuleStoreTestCase
2015-02-04 15:57:01 -05:00
Sarina Canelake
6cdaad58de Merge pull request #6730 from OmarIthawi/edraak/unicode-fixes-log-username
(WIP) Unicode fixes for log messages with username and other unicode input
2015-02-04 11:31:57 -05:00
Calen Pennington
74af3ffa05 Remove unused import 2015-02-04 09:09:15 -05:00
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
Sarina Canelake
01064fcc79 Fix logging calls to use unicode, and lazy logging 2015-02-04 10:53:33 +02:00
Awais Qureshi
22af2b75af ECOM-890: Update invoice data model.
ECOM-891: Allow tracking of invoice transactions.

Authors: Awais Qureshi and Aamir Khan
2015-02-03 13:27:40 -05:00
stephensanchez
5788a74291 Fix ecommerce test for text changes. 2015-01-27 18:13:36 +00:00
Chris Dodge
74f6380e9e Change coupon CSV download to only include counts for coupons redeemed all the way through purchase
updated the failed unit test case and removed the unnessary import
2015-01-23 00:21:58 +05:00
Régis Behmo
f3419bb5bb Render enrollment emails in the student's language
Enrollment, unenrollment and beta role emails should be rendered in the
student's language, and not the instructor's language.
2015-01-20 18:04:35 +01:00
Awais
b12d007138 ECOM-924 Adding redeem code url in attached email file 2015-01-20 19:20:51 +05:00
jsa
17d892c521 make block.get_parent() work.
Co-Authored-By: Christina Roberts <christina@edx.org>
Co-Authored-By: Daniel Friedman <dfriedman@edx.org>
Co-Authored-By: Don Mitchell <dmitchell@edx.org>
2015-01-15 10:33:44 -05:00
Afzal Wali
a8ebf6da7f Added the reportlab requirement to base.txt
Added receipts_pdf.py

Used Paragraph for displaying a large body of text.

added the table

Line breaks in the para text. font size adjusted.

Improved the main table (alignments) and totals (converted to a table as well)

Converted the footer into a table, and allowed for pagination.

Added pagination to item data table.

Handled wrapping of long descriptions into multiple lines.

email attachment for both invoice and receipt

added the currency from the settings

Removed magic numeric literals and added meaningful variables.

Added initial set of substitutions from configuration

add defining logo paths via configuration

Removed font dependencies. Will use the system default fonts which appear good enough to me.

Alignment adjustments as per suggestions.

Fixed the pep8 violations. Added comments to styling

added the decimal points to the price values

Cleanup. Docstrings.

i18n the text in the pdf file

fix pep8/pylint issues

Changed the amounts from string to float.

Overrode the 'pdf_receipt_display_name' property in the OrderItem subclass Donation.

used the PaidCourseRegistration instead of the parent OrderItem to avoid course_id related exceptions.

quality fixes

added  the test cases for the pdf

made the changes in the pdf suggested by griff

updated the pdf tests to assert the pdf content

used the pdfminor library

fix quality issues

made the changes suggested by Will

added the text file that says "pdf file not available. please contact support"
 in case pdf fails to attach in the email
2015-01-15 12:24:30 +05:00
stephensanchez
b188430679 Enable redeem codes.
Update the redeem code schema

Updating the redeem code schema.

Adding migration file.

Adding course mode support when redeeming a code.

Conflicts:
	lms/djangoapps/shoppingcart/views.py

Add sales admin privileges for redeem code generation.

Making sure redeem code URLs work for verified courses.

pep8 violations

Code Review and Test Cleanup changes

Added tests, fixed tests.

Updating the boolean checks in ecommerce template
2015-01-13 15:21:24 +00:00
Muhammad Shoaib
10f8d8c097 WL-135 added the migration for the expiration_date field in the coupons model
added the functionality of adding the expiration date, and also handled in the shopping cart when the user try to add the expired coupon code in the shopping cart

added expiration date in the coupons list in the ecommerce page

added the unit tests and jasmine tests

fix the quality issues and rebased with master

regenerated the migration file with a different number

i18n and verified te course mode

changes suggested by  stephan
2015-01-09 19:14:48 +08:00
Christine Lytwynec
3127ac2b6c mock html_to_text for tests 2015-01-05 16:19:36 -05:00
Muhammad Shoaib
5a437b396e WL-168 When redeeming a Registration Code in the shopping cart, the user should be redirect to the Registration Code Redemption page
improvements suggested by william
2014-12-31 17:45:31 +05:00
Chris Dodge
6198b90051 only display the count for coupon redemptions that actually went through to purchase completion 2014-12-22 10:38:34 -05:00
Adam Palay
c1dd64c07a fix enrollment issue in instructor dash (ECOM-776) 2014-12-12 12:14:17 -05:00
Daniel Friedman
3d91f43030 Support cohorting students via a CSV File.
TNL-735
2014-12-10 09:23:04 -05:00
Sarina Canelake
bfa8349ec4 Clean up Datadump section on legacy dashboard 2014-12-09 13:57:20 -05:00
Sarina Canelake
e3179c37cd Clean up Email section of legacy dashboard 2014-12-09 13:57:20 -05:00
Sarina Canelake
d4a06794d0 Clean up Forum Admin section of legacy dashboard 2014-12-09 13:57:19 -05:00
Sarina Canelake
d8904d9091 Clean up Grade Downloads section of legacy dash 2014-12-09 13:57:19 -05:00
Sarina Canelake
a15110f01c Remove Grade Adjustment code from legacy dash 2014-12-09 13:57:19 -05:00
Muhammad Shoaib
cd30164b5f Improvements and bug fixes for shopping cart: WL-117, WL-114, WL-116, WL-115, WK-122 2014-12-04 01:11:49 -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
640353d94a s/pylint: disable=W0231/pylint: disable=super-init-not-called/ 2014-12-01 11:22:13 -05:00
Sarina Canelake
c0556a7ef8 s/pylint: disable=W0613/pylint: disable=unused-argument/ 2014-12-01 11:22:11 -05:00
Sarina Canelake
1e0f3ddb7d s/pylint: disable=E1111,E1124/pylint: disable=assignment-from-no-return,redundant-keyword-arg/ 2014-12-01 11:22:09 -05:00
Sarina Canelake
19f1dacab2 s/pylint: disable=E1101/pylint: disable=no-member/ 2014-12-01 11:22:09 -05:00