Skip to content
Snippets Groups Projects
Unverified Commit 273ec926 authored by Albert (AJ) St. Aubin's avatar Albert (AJ) St. Aubin Committed by GitHub
Browse files

Merge pull request #17744 from edx/aj/LEARNER-4494

Updating the default long term expiration to be 730 days for entitlem…
parents f3be0ad7 7010eff4
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('entitlements', '0006_courseentitlementsupportdetail_action'),
]
operations = [
migrations.AlterField(
model_name='courseentitlementpolicy',
name='expiration_period',
field=models.DurationField(default=datetime.timedelta(730), help_text=b'Duration in days from when an entitlement is created until when it is expired.'),
),
]
......@@ -27,7 +27,7 @@ class CourseEntitlementPolicy(models.Model):
Represents the Entitlement's policy for expiration, refunds, and regaining a used certificate
"""
DEFAULT_EXPIRATION_PERIOD_DAYS = 450
DEFAULT_EXPIRATION_PERIOD_DAYS = 730
DEFAULT_REFUND_PERIOD_DAYS = 60
DEFAULT_REGAIN_PERIOD_DAYS = 14
......
......@@ -241,8 +241,8 @@ class TestModels(TestCase):
assert expired_at_datetime is None
assert entitlement.expired_at is None
# Verify an entitlement from two years ago is expired and the db row is updated
past_datetime = now() - timedelta(days=365 * 2)
# Verify an entitlement from three years ago day is expired and the db row is updated
past_datetime = now() - timedelta(days=365 * 3)
entitlement.created = past_datetime
entitlement.save()
expired_at_datetime = entitlement.expired_at_datetime
......@@ -285,10 +285,10 @@ class TestModels(TestCase):
assert expired_at_datetime is None
assert entitlement.expired_at is None
# Verify a date 451 days in the past (1 days after the policy expiration)
# Verify a date 731 days in the past (1 days after the policy expiration)
# That is enrolled and started in within the regain period is still expired
entitlement = CourseEntitlementFactory.create(enrollment_course_run=self.enrollment)
expired_datetime = now() - timedelta(days=451)
expired_datetime = now() - timedelta(days=731)
entitlement.created = expired_datetime
start = now()
self.enrollment.created = start
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment