-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
32 lines (25 loc) · 941 Bytes
/
tests.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
from django.test import TestCase
import prefinery_lib
class BetaTest(TestCase):
def setUp(self):
self.tester_email = '[email protected]'
resp = utils.create_tester(self.tester_email, 'invited')
self.tester_id = utils.get_tester_id_by_email(self.tester_email)
self.assertTrue(self.tester_id)
self.assertEqual(resp.status, 201)
def tearDown(self):
resp = utils.delete_tester(self.tester_id)
self.assertEqual(resp.status, 200)
def test_get_code(self):
code = utils.get_tester_code(self.tester_id)
self.assertTrue(code)
def test_check_code_of_tester(self):
code = utils.get_tester_code(self.tester_id)
resp = utils.verify_code(self.tester_id, code)
self.assertTrue(resp)
def test_check_fake_code_of_tester(self):
resp = utils.verify_code(self.tester_id, 'aasdfadsf')
self.assertFalse(resp)
def test_activate_user(self):
resp = utils.set_tester_status(self.tester_id, 'active')
self.assertTrue(resp)