-
Notifications
You must be signed in to change notification settings - Fork 5
/
add-users.py
94 lines (82 loc) · 2.42 KB
/
add-users.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import hashlib
import uuid
from tests import _execute_test
def create_user(username, password, first_name, \
last_name, email, organization):
success, payload = _execute_test(
'admin/get_access_token.json',
None,
None,
None,
None,
{
'username': 'system',
'password': hashlib.sha256('password').hexdigest(),
},
'POST',
)
token = payload['token']
success, payload = _execute_test(
'admin/create_user.json',
token,
None,
None,
None,
{
'user_type': 'moderator',
'client_id': str(uuid.uuid4()),
'username': username,
'password': password,
'first_name': first_name,
'last_name': last_name,
'email': email,
'organization': organization,
'fence_top_left_lat': 43.4,
'fence_top_left_lng': -77.9,
'fence_bottom_right_lat': 43.0,
'fence_bottom_right_lng': -77.3,
},
'POST',
)
print 'New User ID: {0}'.format(payload['user_id'])
if __name__ == '__main__':
create_user(
username = "tduffy",
password = hashlib.sha256('hhroc123%%%').hexdigest(),
first_name = "Tim",
last_name = "Duffy",
email = "[email protected]",
organization = "Hacks/Hackers Rochester, NY",
)
create_user(
username = "mbernius",
password = hashlib.sha256('hhroc123%%%').hexdigest(),
first_name = "Matt",
last_name = "Bernius",
email = "[email protected]",
organization = "Hacks/Hackers Rochester",
)
create_user(
username = "mleonard",
password = hashlib.sha256('wxxi123%%%').hexdigest(),
first_name = "Matt",
last_name = "Leonard",
email = "[email protected]",
organization = "WXXI",
)
create_user(
username = "aruestow",
password = hashlib.sha256('hhroc123%%%').hexdigest(),
first_name = "Andy",
last_name = "Ruestow",
email = "[email protected]",
organization = "Hacks/Hackers Rochester",
)
create_user(
username = "mnolan",
password = hashlib.sha256('hhroc123%%%').hexdigest(),
first_name = "Mike",
last_name = "Nolan",
email = "[email protected]",
organization = "Hacks/Hackers Rochester",
)