Commit Graph

930 Commits

Author SHA1 Message Date
David Ormsbee
3ce87583ab Shift enroll/unenroll logic to CourseEnrollment model, add is_active and mode.
Features coming down the pipe will want to be able to:
* Refer to enrollments before they are actually activated (approval step).
* See what courses a user used to be enrolled in for when they re-enroll in
  the same course, or a different run of that course.
* Have different "modes" of enrolling in a course, representing things like
  honor certificate enrollment, auditing (no certs), etc.

This change adds an is_active flag and mode (with default being "honor").
The commit is only as large as it is because many parts of the codebase were
manipulating enrollments by adding and removing CourseEnrollment objects
directly. It was necessary to create classmethods on CourseEnrollment to
encapsulate this functionality and then port everything over to using them.

The migration to add columns has been tested on a prod replica, and seems to be
fine for running on a live system with single digit millions of rows of
enrollments.
2013-08-14 13:23:06 -04:00
Jay Zoldak
e78edf8ef9 Rename MITX_SETTING AUTOMATIC_AUTH_FOR_LOAD_TESTING -> AUTOMATIC_AUTH_FOR_TESTING because it will be used for acceptance testing also. 2013-08-08 12:08:25 -04:00
Jay Zoldak
385e9de1fd Modify auto_auth to accept parameters for overriding created user attributes. 2013-08-08 12:08:24 -04:00
cahrens
3732d418c9 Add helper methods to hide internals of how users are enrolled in courses.
Remove _

Minor cleanup.
2013-08-06 09:36:39 -04:00
Diana Huang
c867be7961 Limit the rate of logins. 2013-08-02 11:23:59 -04:00
Brian Wilson
635d36fcf9 Add audit log definition, and use for logging of logins in external_auth and student apps. Move test_login to student app. Improve conditional tests for Shibboleth login logic. (Does not include reconfiguring log settings.) 2013-07-31 13:32:21 -04:00
ihoover
56883d65a1 csrf test fix
remove test that csrf middleware is disabled (since we can't seem to reload middleware between tests)

move definitions from setuo into test method
2013-07-24 17:08:18 -04:00
ihoover
402ae4d8bd added csrf tests 2013-07-23 17:32:21 -04:00
ihoover
4148c00cc4 resolve conflicts 2013-07-23 16:26:11 -04:00
Jay Zoldak
ea31b17d57 Fix up auto auth tests. 2013-07-23 16:22:51 -04:00
ihoover
18352e9f20 comment tweaks 2013-07-20 16:20:32 -04:00
ihoover
d7de09442e tweaks 2013-07-20 16:14:41 -04:00
ihoover
967ef6ff94 tests added 2013-07-20 13:01:37 -04:00
cahrens
2cceda948c Disable test point when run under CMS.
The template exists when django admin is enabled, but the mappings in CMS' urls.py do not exist.
2013-07-08 13:12:44 -04:00
Jason Bau
734440f4b9 Refactored tests 2013-06-25 20:21:20 -07:00
Jason Bau
83062c0b7d Tests + Now subclass PasswordResetForm instead of copy
Changed to subclassing django's PasswordResetForm and
overriding clean_password() instead of copy/paste.
Less lines to worry about for diff-cover this way =)
2013-06-24 11:54:31 -07:00
Sarina Canelake
8201ca5e77 Fix 500 error on reactivation email 2013-06-21 12:21:02 -04:00
Don Mitchell
6af4402abd Squash 3 more naive datetime warnings. I think the only ones left are in
migrations.
2013-06-13 10:56:48 -04:00
Calen Pennington
f521b8e8c0 Handle errors while sending emails around changing user data
The most common error is Amazon SES having blacklisted an email address.
However, we handle any error being raised during user.email_user.

Fixes JIRA LMS-131
2013-05-23 10:27:34 -04:00
Calen Pennington
7ef6132194 Make factories return unicode data
Django always returns string data from the database as unicode objects
(ref: https://docs.djangoproject.com/en/1.4/ref/unicode/#models).
Therefor, our factories should do the same
2013-05-22 21:38:07 -04:00
Calen Pennington
2add58bb5a Create sequences for names, emails, and usernames in UserFactory 2013-05-22 21:35:49 -04:00
Greg Price
0f7378a171 Modify UserFactory to create a profile for the user
This allows specification of profile parameters when creating a user. Because
the profile contents are always accessed from the database, the user must be
saved to the database before the profile is created. This means that the
profile cannot be created if the user is merely being built (and not saved)
rather than created.
2013-05-03 10:31:35 -04:00
Jay Zoldak
be76f73107 Consolidate and upgrade factories 2013-04-18 15:11:10 -04:00
Jay Zoldak
0426761bed Update lettuce and factory-boy versions. 2013-04-18 10:18:36 -04:00
Calen Pennington
6644b78819 Fix gradebook when using grade cutoffs other than A/B/C 2013-04-16 11:38:58 -04:00
Jay Zoldak
5eba299dca Move course and item factories to xmodule.modulestore.tests 2013-03-20 12:10:18 -04:00
Jay Zoldak
6048bc2832 Pep8 fixes for factory refactor 2013-03-20 11:31:12 -04:00
Jay Zoldak
3576a3154b Repoint factory references in lettuce tests to world. 2013-03-20 09:38:52 -04:00
Jay Zoldak
1c4ffcf122 Fix import statement for test.py 2013-03-20 09:38:52 -04:00
Jay Zoldak
74653ff8ad Factory refactor working for lms lettuce tests. 2013-03-20 09:38:52 -04:00