mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Make sure status dictionary is assinged each time
The status dictionary was being assigned once, and then subsequent
uses of it were by reference. This meant that each template type was
pointing at the same dictionary, and updating one meant updating all.
This commit adds a dictionary comprehension, which gets evaluated once
for each template type, so each template type has its own `dict` of
statuses.
Before
--
```
Email SMS Letter
| | |
{'sending':, 'failed', …}
```
After
--
```
Email SMS Letter
| | |
{'sending':, {'sending':, {'sending':,
'failed', 'failed', 'failed',
…} …} …}
```
This commit is contained in:
@@ -545,8 +545,8 @@ def test_fetch_monthly_historical_stats_separates_weeks(notify_db, notify_db_ses
|
||||
('2017-03', 'created', 2),
|
||||
):
|
||||
assert result[date]['sms'][status] == count
|
||||
assert result[date]['email'][status] == count
|
||||
assert result[date]['letter'][status] == count
|
||||
assert result[date]['email'][status] == 0
|
||||
assert result[date]['letter'][status] == 0
|
||||
|
||||
assert result.keys() == {
|
||||
'2016-04', '2016-05', '2016-06',
|
||||
|
||||
Reference in New Issue
Block a user