Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
chore: When run test_discovery_program_get this test locally it fai…
Browse files Browse the repository at this point in the history
…ls due to cache issue.
  • Loading branch information
awais786 committed Oct 5, 2023
1 parent b4cda26 commit 5c68bd2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions registrar/apps/core/tests/test_discovery_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,23 @@ def test_discovery_program_get(self, disco_status, disco_json, expected_raw_data
assert isinstance(loaded_program, ProgramDetails)
assert loaded_program.uuid == self.program_uuid
assert loaded_program.raw_data == expected_raw_data
self.assertEqual(len(responses.calls), 1)

# due to cache issue, it fails when run it as single test.

self.assertIn(
'https://discovery-service-base/api/v1/programs/88888888-4444-2222-1111-000000000000',
[x.response.url for x in responses.calls]
)

# This should used the cached Discovery response.
reloaded_program = ProgramDetails(self.program_uuid)
assert isinstance(reloaded_program, ProgramDetails)
assert reloaded_program.uuid == self.program_uuid
assert reloaded_program.raw_data == expected_raw_data
self.assertEqual(len(responses.calls), 1)
self.assertIn(
'https://discovery-service-base/api/v1/programs/88888888-4444-2222-1111-000000000000',
[x.response.url for x in responses.calls]
)

@patch_discovery_client_get_program(program_from_discovery)
def test_active_curriculum(self):
Expand Down

0 comments on commit 5c68bd2

Please sign in to comment.