mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Store boolean values in Redis as valid JSON
Calling `.set()` with `True` stores the byte string `'True'` which cannot subsequently be decoded from JSON (because boolean values in JSON are lowercase, ie `true`).
This commit is contained in:
@@ -90,7 +90,7 @@ class JobApiClient(NotifyAdminAPIClient):
|
|||||||
|
|
||||||
self.redis_client.set(
|
self.redis_client.set(
|
||||||
'has_jobs-{}'.format(service_id),
|
'has_jobs-{}'.format(service_id),
|
||||||
True,
|
b'true',
|
||||||
ex=cache.TTL,
|
ex=cache.TTL,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ def test_client_creates_job_data_correctly(mocker, fake_uuid):
|
|||||||
mock_post.assert_called_once_with(url=expected_url, data=expected_data)
|
mock_post.assert_called_once_with(url=expected_url, data=expected_data)
|
||||||
mock_redis_set.assert_called_once_with(
|
mock_redis_set.assert_called_once_with(
|
||||||
'has_jobs-{}'.format(service_id),
|
'has_jobs-{}'.format(service_id),
|
||||||
True,
|
b'true',
|
||||||
ex=604800,
|
ex=604800,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user