Commit 49b11cb6 by Renzo Lucioni

Exclude UTM parameters from marketing URLs when caching programs

LEARNER-382
parent 4919868c
......@@ -58,7 +58,7 @@ class Command(BaseCommand):
for uuid in uuids:
try:
logger.info('Requesting details for program {uuid}.'.format(uuid=uuid))
program = client.programs(uuid).get()
program = client.programs(uuid).get(exclude_utm=1)
cache_key = PROGRAM_CACHE_KEY_TPL.format(uuid=uuid)
programs[cache_key] = program
......
......@@ -46,10 +46,18 @@ class TestCachePrograms(CatalogIntegrationMixin, CacheIsolationTestCase):
)
def mock_detail(self, uuid, program):
def detail_callback(request, uri, headers):
expected = {
'exclude_utm': ['1'],
}
self.assertEqual(request.querystring, expected)
return (200, headers, json.dumps(program))
httpretty.register_uri(
httpretty.GET,
self.detail_tpl.format(uuid=uuid),
body=json.dumps(program),
body=detail_callback,
content_type='application/json'
)
......
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