|
@@ -6,14 +6,16 @@ from tracim.tests import FunctionalTest
|
6
|
6
|
|
7
|
7
|
class TestLogoutEndpoint(FunctionalTest):
|
8
|
8
|
|
9
|
|
- def test_logout(self):
|
|
9
|
+ def test_api__access_logout_get_enpoint__ok__nominal_case(self):
|
10
|
10
|
res = self.testapp.post_json('/api/v2/sessions/logout', status=204)
|
|
11
|
+
|
|
12
|
+ def test_api__access_logout_post_enpoint__ok__nominal_case(self):
|
11
|
13
|
res = self.testapp.get('/api/v2/sessions/logout', status=204)
|
12
|
14
|
|
13
|
15
|
|
14
|
16
|
class TestLoginEndpoint(FunctionalTest):
|
15
|
17
|
|
16
|
|
- def test_login_ok(self):
|
|
18
|
+ def test_api__try_login_enpoint__ok_204__nominal_case(self):
|
17
|
19
|
params = {
|
18
|
20
|
'email': 'admin@admin.admin',
|
19
|
21
|
'password': 'admin@admin.admin',
|
|
@@ -24,7 +26,7 @@ class TestLoginEndpoint(FunctionalTest):
|
24
|
26
|
status=204,
|
25
|
27
|
)
|
26
|
28
|
|
27
|
|
- def test_bad_password(self):
|
|
29
|
+ def test_api__try_login_enpoint__err_400__bad_password(self):
|
28
|
30
|
params = {
|
29
|
31
|
'email': 'admin@admin.admin',
|
30
|
32
|
'password': 'bad_password',
|
|
@@ -35,7 +37,7 @@ class TestLoginEndpoint(FunctionalTest):
|
35
|
37
|
params=params,
|
36
|
38
|
)
|
37
|
39
|
|
38
|
|
- def test_bad_user(self):
|
|
40
|
+ def test_api__try_login_enpoint__err_400__unregistered_user(self):
|
39
|
41
|
params = {
|
40
|
42
|
'email': 'unknown_user@unknown.unknown',
|
41
|
43
|
'password': 'bad_password',
|
|
@@ -46,13 +48,13 @@ class TestLoginEndpoint(FunctionalTest):
|
46
|
48
|
params=params,
|
47
|
49
|
)
|
48
|
50
|
|
49
|
|
- def test_uncomplete(self):
|
|
51
|
+ def test_api__try_login_enpoint__err_400__no_json_body(self):
|
50
|
52
|
res = self.testapp.post_json('/api/v2/sessions/login', status=400)
|
51
|
53
|
|
52
|
54
|
|
53
|
55
|
class TestWhoamiEndpoint(FunctionalTest):
|
54
|
56
|
|
55
|
|
- def test_whoami_ok(self):
|
|
57
|
+ def test_api__try_whoami_enpoint__ok_200__nominal_case(self):
|
56
|
58
|
self.testapp.authorization = (
|
57
|
59
|
'Basic',
|
58
|
60
|
(
|
|
@@ -71,7 +73,7 @@ class TestWhoamiEndpoint(FunctionalTest):
|
71
|
73
|
assert res.json_body['caldav_url'] is None
|
72
|
74
|
assert res.json_body['avatar_url'] is None
|
73
|
75
|
|
74
|
|
- def test_unauthenticated(self):
|
|
76
|
+ def test_api__try_whoami_enpoint__err_401__unauthenticated(self):
|
75
|
77
|
self.testapp.authorization = (
|
76
|
78
|
'Basic',
|
77
|
79
|
(
|