feat: only fetch published pathways (#36332)
* feat: only fetch published pathways
This commit is contained in:
@@ -200,7 +200,7 @@ class Command(BaseCommand):
|
||||
failure = False
|
||||
logger.info(f'Requesting pathways for {site.domain}.')
|
||||
try:
|
||||
api_url = urljoin(f"{api_base_url}/", "pathways/")
|
||||
api_url = urljoin(f"{api_base_url}/", "pathways/?status=published")
|
||||
next_page = 1
|
||||
while next_page:
|
||||
response = client.get(api_url, params=dict(exclude_utm=1, page=next_page))
|
||||
|
||||
@@ -142,6 +142,7 @@ class TestCachePrograms(CatalogIntegrationMixin, CacheIsolationTestCase, SiteMix
|
||||
expected = {
|
||||
'exclude_utm': ['1'],
|
||||
'page': [str(page_number)],
|
||||
'status': ['published']
|
||||
}
|
||||
assert request.querystring == expected
|
||||
|
||||
@@ -156,7 +157,7 @@ class TestCachePrograms(CatalogIntegrationMixin, CacheIsolationTestCase, SiteMix
|
||||
|
||||
httpretty.register_uri(
|
||||
httpretty.GET,
|
||||
self.pathway_url + f'?exclude_utm=1&page={page_number}',
|
||||
self.pathway_url + f'?status=published&exclude_utm=1&page={page_number}',
|
||||
body=pathways_callback,
|
||||
content_type='application/json',
|
||||
match_querystring=True,
|
||||
|
||||
@@ -290,3 +290,4 @@ class PathwayFactory(DictFactoryBase):
|
||||
org_name = factory.Faker('company')
|
||||
programs = factory.LazyFunction(partial(generate_instances, ProgramFactory))
|
||||
pathway_type = FuzzyChoice(path_type.value for path_type in PathwayType)
|
||||
status = 'published'
|
||||
|
||||
Reference in New Issue
Block a user