-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrey Rusakov
committed
Nov 19, 2024
1 parent
6f80814
commit 5b88b2d
Showing
3 changed files
with
0 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,43 +33,6 @@ def setUp(self): | |
self.assertTrue('access' in resp.data) | ||
self.token = resp.data['access'] | ||
|
||
def test_user_create_private(self): | ||
url = reverse('auth_register') | ||
data = { | ||
'username': 'jdupond', | ||
'first_name': 'Jean', | ||
'last_name': 'Dupond', | ||
'street': 'Tivoli 22', | ||
'city': 'Neuchâtel-les-Bains', | ||
'email': '[email protected]', | ||
'password1': 'testPa$$word', | ||
'password2': 'testPa$$word' | ||
} | ||
response = self.client.post(url, data, format='json') | ||
self.assertEqual(response.status_code, status.HTTP_200_OK, response.content) | ||
self.assertEqual(len(mail.outbox), 2, 'An email has been sent to admins and to the new user') | ||
|
||
def test_user_create_with_company(self): | ||
url = reverse('auth_register') | ||
data = { | ||
'username': 'jdupond', | ||
'first_name': 'Jean', | ||
'last_name': 'Dupond', | ||
'street': 'Tivoli 22', | ||
'city': 'Neuchâtel-les-Bains', | ||
'email': '[email protected]', | ||
'company_name': 'SITN', | ||
'ide_id': 'CHE-25', | ||
'password1': 'testPa$$word', | ||
'password2': 'testPa$$word' | ||
} | ||
response = self.client.post(url, data, format='json') | ||
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST, 'IDE number is not valid') | ||
data['ide_id'] = 'CHE-999.999.999' | ||
response = self.client.post(url, data, format='json') | ||
self.assertEqual(response.status_code, status.HTTP_200_OK, response.content) | ||
self.assertEqual(len(mail.outbox), 2, 'An email has been sent to admins and to the new user') | ||
|
||
def test_user_change(self): | ||
""" | ||
Tests POST of an user change request | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters