From c10a721c0eeac6019ee87b5cb944d2c53838f412 Mon Sep 17 00:00:00 2001 From: TannedCung Date: Fri, 28 Jun 2024 13:44:30 +0700 Subject: [PATCH] Update: testcases --- .env_sample | 1 + docker-compose-prod.yml | 4 +++- tests/test_set_00_invoice_05_imeis.py | 4 ++-- tests/test_set_06_invoice_only.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.env_sample b/.env_sample index 0edcda4..78406c4 100644 --- a/.env_sample +++ b/.env_sample @@ -1,4 +1,5 @@ MEDIA_ROOT=/app/media +LOG_ROOT=/app/log # DATABASE django setup DB_ENGINE=django.db.backends.postgresql_psycopg2 DB_SCHEMA=sbt_dev diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml index 6f19166..b92248e 100644 --- a/docker-compose-prod.yml +++ b/docker-compose-prod.yml @@ -67,8 +67,9 @@ services: volumes: - BE_media:${MEDIA_ROOT} - BE_static:/app/static + - /var/log:${LOG_ROOT} working_dir: /app - command: sh -c "chmod -R 777 /app; sleep 5; python manage.py collectstatic --no-input && + command: sh -c "sudo chmod -R 777 /app; sleep 5; python manage.py collectstatic --no-input && python manage.py migrate && python manage.py compilemessages && gunicorn fwd.asgi:application -k uvicorn.workers.UvicornWorker --timeout 300 -b 0.0.0.0:9000" # pre-makemigrations on prod @@ -145,6 +146,7 @@ services: rabbitmq-sbt: condition: service_started volumes: + - /var/log:${LOG_ROOT} - BE_media:${MEDIA_ROOT} working_dir: /app command: sh -c "celery -A fwd_api.celery_worker.worker worker -l INFO -c 5" diff --git a/tests/test_set_00_invoice_05_imeis.py b/tests/test_set_00_invoice_05_imeis.py index bc62e3f..b2a85ce 100644 --- a/tests/test_set_00_invoice_05_imeis.py +++ b/tests/test_set_00_invoice_05_imeis.py @@ -14,13 +14,13 @@ def check_invoice_data(document): assert document["doc_type"] == "sbt_document" assert get_field(document, "retailername") == "Arrow Communication" assert get_field(document, "sold_to_party") is None - assert "2021-02-09" in get_field(document, "purchase_date") + assert "2024-02-09" in get_field(document, "purchase_date") def check_invoice_data_2(document): assert document["doc_type"] == "sbt_document" assert get_field(document, "retailername") == "Starhub Shop" assert get_field(document, "sold_to_party") is None - assert "2022-02-22" in get_field(document, "purchase_date") + assert "2024-02-22" in get_field(document, "purchase_date") def test_1_invoice_1_imei(): invoice_files = [ diff --git a/tests/test_set_06_invoice_only.py b/tests/test_set_06_invoice_only.py index f709090..41386a9 100644 --- a/tests/test_set_06_invoice_only.py +++ b/tests/test_set_06_invoice_only.py @@ -14,7 +14,7 @@ def check_invoice_data_2(document): assert document["doc_type"] == "sbt_document" assert get_field(document, "retailername") == "Starhub Shop" assert get_field(document, "sold_to_party") is None - assert "2022-02-22" in get_field(document, "purchase_date") + assert "2024-02-22" in get_field(document, "purchase_date") def test_invoice_only():