Skip to content

Commit

Permalink
start writing integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
steph-feng committed Nov 10, 2024
1 parent cfeabb2 commit c613a6d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions i18nilize/integration_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# to be removed

from src.internationalize.helpers import generate_file
from core.i18nilize.models import Token
import requests

def integration_test():
# create token
token_response = requests.post('http://localhost:8000/api/create-token/')
token_data = token_response.json()
token = token_data['value']

# create translations
translations_data = {
'translations': [
{
'language': 'french',
'hello': 'bonjour',
'thanks': 'merci'
}
]
}
headers = {
'Authorization': f'Token {token}'
}
translations_response = requests.post(
'http://localhost:8000/api/process-translations/',
data=translations_data,
headers=headers
)

generate_file('french', token)

integration_test()

0 comments on commit c613a6d

Please sign in to comment.