Добавление тестов
This commit is contained in:
@@ -17,18 +17,53 @@ headers = {
|
||||
'Cookie': f'csrftoken={csrftoken}'
|
||||
}
|
||||
|
||||
data = {
|
||||
# "lastname": "Qweqov",
|
||||
# "firstname": "Petr",
|
||||
# "middlename": "Qweyekovich",
|
||||
# "username": "PetrQweqov",
|
||||
# "password": "PetrQweqov@yandex.ru",
|
||||
# "email": "PetrQweqov@yandex.ru",
|
||||
# "phone": "89009401234",
|
||||
}
|
||||
|
||||
response = requests.post(url, headers=headers, data=data)
|
||||
|
||||
print('Сценарий 1. Не указаны никакие данные:')
|
||||
print(f'Код ответа: {response.status_code}')
|
||||
# print(response.content)
|
||||
print(f'Данные: {response.json()}')
|
||||
|
||||
data = {
|
||||
"lastname": "Qweqov",
|
||||
"firstname": "Petr",
|
||||
"middlename": "Qweyekovich",
|
||||
"username": "PetrQweqov",
|
||||
"password": "PetrQweqov@yandex.ru",
|
||||
"email": "PetrQweqov@yandex.ru",
|
||||
"phone": "89009401234",
|
||||
"email": "PetrQweqovyandex.ru",
|
||||
"phone": "8900940134",
|
||||
}
|
||||
|
||||
response = requests.post(url, headers=headers, data=data)
|
||||
|
||||
print(response.status_code)
|
||||
print(response.content)
|
||||
print(response.json())
|
||||
print('Сценарий 2. Некорректная длина имени:')
|
||||
print(f'Код ответа: {response.status_code}')
|
||||
# print(response.content)
|
||||
print(f'Данные: {response.json()}')
|
||||
|
||||
data = {
|
||||
"lastname": "Qweqov",
|
||||
"firstname": "Petreeee",
|
||||
"middlename": "Qweyekovich",
|
||||
"username": "PetrQweqov",
|
||||
"password": "PetrQweqov@yandex.ru",
|
||||
"email": "PetrQweqov@yandex.ru",
|
||||
"phone": "89009401134",
|
||||
}
|
||||
|
||||
response = requests.post(url, headers=headers, data=data)
|
||||
|
||||
print('Сценарий 3. Успешная регистрация:')
|
||||
print(f'Код ответа: {response.status_code}')
|
||||
# print(response.content)
|
||||
print(f'Данные: {response.json()}')
|
||||
Reference in New Issue
Block a user