Skip to content

Commit

Permalink
resolve issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jocelyn-AGORO committed Sep 14, 2024
1 parent 5afb4ee commit 76d7496
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
git checkout main
git pull origin main
git fetch origin rabbitmq:rabbitmq # Récupération explicite de la branche dev
git merge -X theirs rabbitmq
git merge rabbitmq
git push origin main
fi
16 changes: 7 additions & 9 deletions kawa_product/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.0/ref/settings/
"""
# from decouple import config
from decouple import config
from os import getenv
from pathlib import Path
import os
import logging
Expand All @@ -28,7 +26,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = [getenv('ALLOWED_HOSTS_1'), getenv('ALLOWED_HOSTS_2')]
ALLOWED_HOSTS = [config('ALLOWED_HOSTS_1'), config('ALLOWED_HOSTS_2')]

DJANGO_SETTINGS_MODULE = "kawa_product.settings"

Expand Down Expand Up @@ -84,14 +82,14 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': getenv('MYSQL_DATABASE'),
'USER': getenv('MYSQL_USER', 'root'),
'PASSWORD': getenv('MYSQL_PASSWORD', ''),
'HOST': getenv('DB_HOST', 'mysql'),
'PORT': int(getenv('MYSQL_PORT', '3307')),
'NAME': config('MYSQL_DATABASE'),
'USER': config('MYSQL_USER', 'root'),
'PASSWORD': config('MYSQL_PASSWORD', ''),
'HOST': config('DB_HOST', 'mysql'),
'PORT': int(config('MYSQL_PORT', '3307')),
'TEST': {
'ENGINE': 'django.db.backends.mysql',
'NAME': getenv('MYSQL_TEST_DATABASE'),
'NAME': config('MYSQL_TEST_DATABASE'),
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions products/tests/test_auth.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# from decouple import config
from os import getenv
from decouple import config
import requests
from django.test import TestCase


class AuthTest(TestCase):

def setUp(self):
self.API_BASE_URL = getenv('CUSTOMER_API_URL')
self.API_BASE_URL = config('CUSTOMER_API_URL')
self.new_user = {
"nom": "epsi",
"prenom": "test",
Expand Down
5 changes: 2 additions & 3 deletions products/tests/test_produit_controller.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import requests
# from decouple import config
from os import getenv
from decouple import config
from django.test import TestCase, Client
from django.conf import settings
from products.models import Produit
Expand All @@ -14,7 +13,7 @@ class ProduitControllerTest(TestCase):
def setUp(self):
self.SUCCESS_PRODUCT_ID = 1
self.ERROR_PRODUCT_ID = 10000
self.API_BASE_URL = getenv('CUSTOMER_API_URL')
self.API_BASE_URL = config('CUSTOMER_API_URL')
self.produit_controller = ProduitController(ProduitServiceImpl(settings))
self.client = Client()
for i in range(1, 4):
Expand Down
5 changes: 2 additions & 3 deletions services/authentication.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# from decouple import config
from os import getenv
from decouple import config
import requests
from ninja.security import APIKeyHeader
from schemas.types import AuthResponse

API_BASE_URL = getenv('CUSTOMER_API_URL')
API_BASE_URL = config('CUSTOMER_API_URL')

class ApiKey(APIKeyHeader):
param_name = "x-access-token"
Expand Down

0 comments on commit 76d7496

Please sign in to comment.