Commit 9c4c0383 by Albert St. Aubin Committed by Albert (AJ) St. Aubin

Defaulted one_click_purchase_enabled to True

[LEARNER-4061]
parent d123c957
...@@ -89,7 +89,7 @@ class TestProgramViewSet(SerializationMixin): ...@@ -89,7 +89,7 @@ class TestProgramViewSet(SerializationMixin):
def test_retrieve(self, django_assert_num_queries): def test_retrieve(self, django_assert_num_queries):
""" Verify the endpoint returns the details for a single program. """ """ Verify the endpoint returns the details for a single program. """
program = self.create_program() program = self.create_program()
with django_assert_num_queries(47): with django_assert_num_queries(56):
response = self.assert_retrieve_success(program) response = self.assert_retrieve_success(program)
# property does not have the right values while being indexed # property does not have the right values while being indexed
del program._course_run_weeks_to_complete del program._course_run_weeks_to_complete
...@@ -115,7 +115,7 @@ class TestProgramViewSet(SerializationMixin): ...@@ -115,7 +115,7 @@ class TestProgramViewSet(SerializationMixin):
partner=self.partner) partner=self.partner)
# property does not have the right values while being indexed # property does not have the right values while being indexed
del program._course_run_weeks_to_complete del program._course_run_weeks_to_complete
with django_assert_num_queries(31): with django_assert_num_queries(38):
response = self.assert_retrieve_success(program) response = self.assert_retrieve_success(program)
assert response.data == self.serialize_program(program) assert response.data == self.serialize_program(program)
assert course_list == list(program.courses.all()) # pylint: disable=no-member assert course_list == list(program.courses.all()) # pylint: disable=no-member
...@@ -124,7 +124,7 @@ class TestProgramViewSet(SerializationMixin): ...@@ -124,7 +124,7 @@ class TestProgramViewSet(SerializationMixin):
""" Verify the endpoint returns data for a program even if the program's courses have no course runs. """ """ Verify the endpoint returns data for a program even if the program's courses have no course runs. """
course = CourseFactory(partner=self.partner) course = CourseFactory(partner=self.partner)
program = ProgramFactory(courses=[course], partner=self.partner) program = ProgramFactory(courses=[course], partner=self.partner)
with django_assert_num_queries(24): with django_assert_num_queries(25):
response = self.assert_retrieve_success(program) response = self.assert_retrieve_success(program)
assert response.data == self.serialize_program(program) assert response.data == self.serialize_program(program)
...@@ -151,7 +151,7 @@ class TestProgramViewSet(SerializationMixin): ...@@ -151,7 +151,7 @@ class TestProgramViewSet(SerializationMixin):
""" Verify the endpoint returns a list of all programs. """ """ Verify the endpoint returns a list of all programs. """
expected = [self.create_program() for __ in range(3)] expected = [self.create_program() for __ in range(3)]
expected.reverse() expected.reverse()
self.assert_list_results(self.list_path, expected, 16) self.assert_list_results(self.list_path, expected, 25)
# Verify that repeated list requests use the cache. # Verify that repeated list requests use the cache.
self.assert_list_results(self.list_path, expected, 4) self.assert_list_results(self.list_path, expected, 4)
...@@ -275,13 +275,13 @@ class TestProgramViewSet(SerializationMixin): ...@@ -275,13 +275,13 @@ class TestProgramViewSet(SerializationMixin):
program.marketing_slug = SLUG program.marketing_slug = SLUG
program.save() program.save()
self.assert_list_results(url, [program], 16) self.assert_list_results(url, [program], 19)
def test_list_exclude_utm(self): def test_list_exclude_utm(self):
""" Verify the endpoint returns marketing URLs without UTM parameters. """ """ Verify the endpoint returns marketing URLs without UTM parameters. """
url = self.list_path + '?exclude_utm=1' url = self.list_path + '?exclude_utm=1'
program = self.create_program() program = self.create_program()
self.assert_list_results(url, [program], 15, extra_context={'exclude_utm': 1}) self.assert_list_results(url, [program], 18, extra_context={'exclude_utm': 1})
def test_minimal_serializer_use(self): def test_minimal_serializer_use(self):
""" Verify that the list view uses the minimal serializer. """ """ Verify that the list view uses the minimal serializer. """
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-03-19 17:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0078_merge_20180209_1044'),
]
operations = [
migrations.AlterField(
model_name='program',
name='one_click_purchase_enabled',
field=models.BooleanField(default=True, help_text='Allow courses in this program to be purchased in a single transaction'),
),
]
...@@ -988,7 +988,7 @@ class Program(TimeStampedModel): ...@@ -988,7 +988,7 @@ class Program(TimeStampedModel):
blank=True, null=True blank=True, null=True
) )
one_click_purchase_enabled = models.BooleanField( one_click_purchase_enabled = models.BooleanField(
default=False, default=True,
help_text=_('Allow courses in this program to be purchased in a single transaction') help_text=_('Allow courses in this program to be purchased in a single transaction')
) )
hidden = models.BooleanField( hidden = models.BooleanField(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment