Skip to content

Commit

Permalink
Merge pull request #19 from pitangainnovare/fix-language-prefix-error…
Browse files Browse the repository at this point in the history
…-pytest

Corrige configuração de idioma
  • Loading branch information
pitangainnovare authored Jun 1, 2024
2 parents 31c9607 + d6a6662 commit 4fe34a4
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 30 deletions.
23 changes: 3 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,6 @@ concurrency:
cancel-in-progress: true

jobs:
linter:
runs-on: ubuntu-latest
steps:

- name: Checkout Code Repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: pip
cache-dependency-path: |
requirements/base.txt
requirements/local.txt
- name: Run pre-commit
uses: pre-commit/[email protected]

# With no caching at all the entire ci process takes 4m 30s to complete!
pytest:
runs-on: ubuntu-latest

Expand All @@ -50,6 +30,9 @@ jobs:
- name: Build the Stack
run: docker-compose -f local.yml build

- name: Make the migrations
run: docker compose -f local.yml run --rm django python manage.py makemigrations

- name: Run DB Migrations
run: docker-compose -f local.yml run --rm django python manage.py migrate

Expand Down
6 changes: 3 additions & 3 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# In Windows, this must be set to your system time zone.
TIME_ZONE = "UTC"
# https://docs.djangoproject.com/en/dev/ref/settings/#language-code
LANGUAGE_CODE = "pt-BR"
LANGUAGE_CODE = "pt-br"
# https://docs.djangoproject.com/en/dev/ref/settings/#site-id
SITE_ID = 1
# https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
Expand Down Expand Up @@ -364,15 +364,15 @@
LANGUAGES = [
("en", "English"),
("es", "Spanish"),
("pt-BR", "Portuguese"),
("pt-br", "Portuguese"),
]

WAGTAIL_I18N_ENABLED = True

WAGTAIL_CONTENT_LANGUAGES = [
("en", "English"),
("es", "Spanish"),
("pt-BR", "Portuguese"),
("pt-br", "Portuguese"),
]

NOCAPTCHA = True
Expand Down
1 change: 1 addition & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
path("i18n/", include("django.conf.urls.i18n")),
path("", include("allauth.urls")),
path("", include(wagtail_urls)),
prefix_default_language=False,
)

if settings.DEBUG:
Expand Down
1 change: 1 addition & 0 deletions core/users/tests/test_urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from django.urls import resolve, reverse

from core.users.models import User
Expand Down
2 changes: 1 addition & 1 deletion local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
image: edoburu/pgbouncer:1.14.0
container_name: scielo_usage_local_pgbouncer
environment:
- DATABASE_URL=postgres://GVRFlLmcCNfGLhsFvSnCioYOPJPYpyfj:BQ4hSUL4rdj5WZLdR8ilDLRQMvCtzo0caMaXDO0olGsmycQjlcZlTVK9DepZR8kk@postgres/scielo_core
- DATABASE_URL=postgres://GVRFlLmcCNfGLhsFvSnCioYOPJPYpyfj:BQ4hSUL4rdj5WZLdR8ilDLRQMvCtzo0caMaXDO0olGsmycQjlcZlTVK9DepZR8kk@postgres/scielo_usage
- MAX_CLIENT_CONN=100
ports:
- 6439:5432
Expand Down
4 changes: 2 additions & 2 deletions log_manager/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def task_discover(self, collection_acron2, is_enabled=True, temporal_reference=N
raise exceptions.InvalidDateFormatError('ERROR. Please, use a valid date format (YYYY-MM-DD).')

for cd in col_configs_dirs:
for root, _, files in os.walk(cd.value):
for root, _sub_dirs, files in os.walk(cd.value):
for name in files:
_, extension = os.path.splitext(name)
_name, extension = os.path.splitext(name)
if extension.lower() not in app_config_log_file_formats:
continue

Expand Down
8 changes: 4 additions & 4 deletions production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
image: edoburu/pgbouncer:1.14.0
restart: always
environment:
- DATABASE_URL=postgres://GVRFlLmcCNfGLhsFvSnCioYOPJPYpyfj:DAkWfpsnPHcAxMeQk2QmPOIZuz4BXG5qGFWi2hCCQE6kvndJHTuzz8SjnxOJY5qj@postgres/core
- DATABASE_URL=postgres://GVRFlLmcCNfGLhsFvSnCioYOPJPYpyfj:DAkWfpsnPHcAxMeQk2QmPOIZuz4BXG5qGFWi2hCCQE6kvndJHTuzz8SjnxOJY5qj@postgres/scielo_usage
- MAX_CLIENT_CONN=100
ports:
- 6434:5432
Expand All @@ -39,8 +39,8 @@ services:
dockerfile: ./compose/production/postgres/Dockerfile
image: scielo_usage_production_postgres
volumes:
- ../scms_data/scielo_core/data_prod:/var/lib/postgresql/data:Z
- ../scms_data/scielo_core/data_prod_backup:/backups:z
- ../scms_data/scielo_usage/data_prod:/var/lib/postgresql/data:Z
- ../scms_data/scielo_usage/data_prod_backup:/backups:z
ports:
- "5432:5432"
env_file:
Expand All @@ -65,7 +65,7 @@ services:
depends_on:
- django
volumes:
- ../scms_data/scielo_core/traefik:/etc/traefik/acme:z
- ../scms_data/scielo_usage/traefik:/etc/traefik/acme:z
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
Expand Down

0 comments on commit 4fe34a4

Please sign in to comment.