-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #908 from alphagov/dev
v0.6.154 - Use reporting instead of testing complete date in Case metrics
- Loading branch information
Showing
15 changed files
with
135 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,11 +61,26 @@ test: | |
int_test: | ||
docker compose --file stack_tests/integration_tests/docker-compose.yml up --abort-on-container-exit | ||
|
||
local_stack_up: | ||
docker compose --file docker-compose-full-stack.yml up --build | ||
|
||
local_stack_make_admin: | ||
docker compose exec web sh -c "echo \"from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('[email protected]', '[email protected]', 'secret')\" | python manage.py shell" | ||
|
||
local_stack_cleanup: | ||
rm -r data/postgres-data-full-stack | ||
|
||
deploy_prototype: | ||
python aws_prototype/main.py -b up -fd | ||
|
||
deploy_prototype_no_flush: | ||
python aws_prototype/main.py -b up | ||
|
||
breakdown_prototype: | ||
python aws_prototype/main.py -b down | ||
|
||
new_account_prototype: | ||
python aws_prototype/main.py -b newaccount | ||
|
||
prototype_reload_database: | ||
python aws_prototype/main.py -b reload_database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
from typing import Any | ||
|
||
import pytest | ||
from django.http import HttpResponse | ||
from django.http import HttpResponse, StreamingHttpResponse | ||
|
||
from ...audits.models import Audit | ||
from ...cases.models import Case, Contact | ||
|
@@ -54,9 +54,17 @@ | |
CONTACT_EMAIL: str = "[email protected]" | ||
|
||
|
||
def decode_csv_response(response: HttpResponse) -> tuple[list[str], list[list[str]]]: | ||
def decode_csv_response( | ||
response: HttpResponse | StreamingHttpResponse, | ||
) -> tuple[list[str], list[list[str]]]: | ||
"""Decode CSV HTTP response and break into column names and data""" | ||
content: str = response.content.decode("utf-8") | ||
if isinstance(response, StreamingHttpResponse): | ||
content_chunks: list[str] = [ | ||
chunk.decode("utf-8") for chunk in response.streaming_content | ||
] | ||
content: str = "".join(content_chunks) | ||
else: | ||
content: str = response.content.decode("utf-8") | ||
csv_reader: Any = csv.reader(io.StringIO(content)) | ||
csv_body: list[list[str]] = list(csv_reader) | ||
csv_header: list[str] = csv_body.pop(0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.