forked from openedx-unsupported/ecommerce
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from edly-io/rehan/EDLY-2006
Refactored number_of_courses to subscription_number_of_courses
- Loading branch information
Showing
14 changed files
with
72 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
""" | ||
Subscription constants. | ||
""" | ||
|
||
LIMITED_ACCESS = 'limited-access' | ||
FULL_ACCESS_COURSES = 'full-access-courses' | ||
FULL_ACCESS_TIME_PERIOD = 'full-access-time-period' | ||
LIFETIME_ACCESS = 'lifetime-access' | ||
|
||
SUBSCRIPTION_TYPES = [LIMITED_ACCESS, FULL_ACCESS_COURSES, FULL_ACCESS_TIME_PERIOD, LIFETIME_ACCESS] | ||
SUBSCRIPTION_DURATION_UNIT_OPTIONS = ['days', 'months', 'years'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
""" | ||
Subscription utility methods. | ||
""" | ||
from datetime import date | ||
from factory.fuzzy import ( | ||
FuzzyChoice, | ||
FuzzyDate, | ||
FuzzyInteger, | ||
) | ||
|
||
from ecommerce.subscriptions.api.v2.tests.constants import SUBSCRIPTION_TYPES | ||
|
||
|
||
def mock_user_subscription(): | ||
""" | ||
Mock LMS response for user subscription. | ||
""" | ||
return { | ||
'subscription_id': FuzzyInteger(1, 100).fuzz(), | ||
'subscription_type': FuzzyChoice(SUBSCRIPTION_TYPES).fuzz(), | ||
'expiration_date': FuzzyDate(start_date=date.today()).fuzz().strftime('%Y-%m-%d'), | ||
'course_enrollments': [], | ||
'max_allowed_courses': FuzzyInteger(1, 10).fuzz(), | ||
'user': FuzzyInteger(1, 10).fuzz() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters