-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
42 lines (29 loc) · 869 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import sys
sys.stdin.reconfigure(encoding='utf-8')
sys.stdout.reconfigure(encoding='utf-8')
import requests
import secrets
import string
url = "http://127.0.0.1:8000/user/register/"
loginUrl = "http://127.0.0.1:8000/user/login/"
isBugFree = False
for i in range(50):
N = 20
res = ''.join(secrets.choice(string.ascii_uppercase) for _ in range(N))
PARAMETERS = {
'username': "{}".format(res),
'email': "user@{}.com".format(res),
'password': "Jayash@403",
'password2': "Jayash@403"
}
r = requests.post(url, PARAMETERS)
LOGINPARAMETERS = {
'username': "{}".format(res),
'password': "Jayash@403"
}
r = requests.post(loginUrl, PARAMETERS)
if not str(r.text).startswith('{"token"'):
isBugFree = True
print(r.text)
if isBugFree:
print("Passed All Test Cases!")