Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f4dc1f33
Commit
f4dc1f33
authored
Nov 02, 2015
by
Bill DeRusha
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10471 from edx/bderusha/refund-follow-on
Compare all refund dates in UTC
parents
36f05c86
6123827a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
common/djangoapps/student/models.py
+2
-2
common/djangoapps/student/tests/test_refunds.py
+3
-3
No files found.
common/djangoapps/student/models.py
View file @
f4dc1f33
...
@@ -1377,7 +1377,7 @@ class CourseEnrollment(models.Model):
...
@@ -1377,7 +1377,7 @@ class CourseEnrollment(models.Model):
# If it is after the refundable cutoff date they should not be refunded.
# If it is after the refundable cutoff date they should not be refunded.
refund_cutoff_date
=
self
.
refund_cutoff_date
()
refund_cutoff_date
=
self
.
refund_cutoff_date
()
if
refund_cutoff_date
and
datetime
.
now
()
>
refund_cutoff_date
:
if
refund_cutoff_date
and
datetime
.
now
(
UTC
)
>
refund_cutoff_date
:
return
False
return
False
course_mode
=
CourseMode
.
mode_for_course
(
self
.
course_id
,
'verified'
)
course_mode
=
CourseMode
.
mode_for_course
(
self
.
course_id
,
'verified'
)
...
@@ -1400,7 +1400,7 @@ class CourseEnrollment(models.Model):
...
@@ -1400,7 +1400,7 @@ class CourseEnrollment(models.Model):
self
.
course_overview
.
start
.
replace
(
tzinfo
=
None
)
self
.
course_overview
.
start
.
replace
(
tzinfo
=
None
)
)
)
return
refund_window_start_date
+
EnrollmentRefundConfiguration
.
current
()
.
refund_window
return
refund_window_start_date
.
replace
(
tzinfo
=
UTC
)
+
EnrollmentRefundConfiguration
.
current
()
.
refund_window
@property
@property
def
username
(
self
):
def
username
(
self
):
...
...
common/djangoapps/student/tests/test_refunds.py
View file @
f4dc1f33
...
@@ -113,10 +113,10 @@ class RefundableTest(SharedModuleStoreTestCase):
...
@@ -113,10 +113,10 @@ class RefundableTest(SharedModuleStoreTestCase):
self
.
assertTrue
(
self
.
enrollment
.
refundable
())
self
.
assertTrue
(
self
.
enrollment
.
refundable
())
with
patch
(
'student.models.CourseEnrollment.refund_cutoff_date'
)
as
cutoff_date
:
with
patch
(
'student.models.CourseEnrollment.refund_cutoff_date'
)
as
cutoff_date
:
cutoff_date
.
return_value
=
datetime
.
now
(
)
-
timedelta
(
days
=
1
)
cutoff_date
.
return_value
=
datetime
.
now
(
pytz
.
UTC
)
-
timedelta
(
minutes
=
5
)
self
.
assertFalse
(
self
.
enrollment
.
refundable
())
self
.
assertFalse
(
self
.
enrollment
.
refundable
())
cutoff_date
.
return_value
=
datetime
.
now
(
)
+
timedelta
(
days
=
1
)
cutoff_date
.
return_value
=
datetime
.
now
(
pytz
.
UTC
)
+
timedelta
(
minutes
=
5
)
self
.
assertTrue
(
self
.
enrollment
.
refundable
())
self
.
assertTrue
(
self
.
enrollment
.
refundable
())
@ddt.data
(
@ddt.data
(
...
@@ -132,7 +132,7 @@ class RefundableTest(SharedModuleStoreTestCase):
...
@@ -132,7 +132,7 @@ class RefundableTest(SharedModuleStoreTestCase):
"""
"""
Assert that the later date is used with the configurable refund period in calculating the returned cutoff date.
Assert that the later date is used with the configurable refund period in calculating the returned cutoff date.
"""
"""
now
=
datetime
.
now
()
.
replace
(
microsecond
=
0
)
now
=
datetime
.
now
(
pytz
.
UTC
)
.
replace
(
microsecond
=
0
)
order_date
=
now
+
order_date_delta
order_date
=
now
+
order_date_delta
course_start
=
now
+
course_start_delta
course_start
=
now
+
course_start_delta
expected_date
=
now
+
expected_date_delta
expected_date
=
now
+
expected_date_delta
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment