-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathutils.py
More file actions
28 lines (20 loc) · 568 Bytes
/
utils.py
File metadata and controls
28 lines (20 loc) · 568 Bytes
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
from app.models import Key
FAKE_EMAIL = 'test@example.org'
FAKE_APIKEY = 'abcdef1234567890'
def create_fake_key(session, **kwargs):
kwargs['email'] = kwargs.get('email', FAKE_EMAIL)
kwargs['apikey'] = kwargs.get('apikey', FAKE_APIKEY)
key = Key(**kwargs)
session.add(key)
session.commit()
return key
def apikey_commit(client, email, password, **kwargs):
response = client.post(
'api/v1/apikey',
**kwargs,
json=dict(
email=email,
password=password
),
)
return response