Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
django
djangorestframework
djangorestframework-simplejwt
djangorestframework-simplejwt
pytest
pytest-django
18 changes: 18 additions & 0 deletions softdesk/api/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
from django.test import TestCase
from rest_framework.test import APIClient

client = APIClient()


# Create your tests here.
def test_register():
request = {
'email': 'email@truc.fr',
'password1': '11111',
'password2': '11111',
'first_name': 'First',
'last_name': 'Last'
}
response = client.post('/signup', request, format='json')

assert response.status_code == 201
# TODO test the response
print(response.data)

4 changes: 4 additions & 0 deletions softdesk/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
DJANGO_SETTINGS_MODULE = softdesk.settings
python_files = tests.py test_*.py *_tests.py
rootdir=.