|
@@ -1,5 +1,6 @@
|
1
|
1
|
# coding=utf-8
|
2
|
2
|
from tracim_backend.tests import FunctionalTest
|
|
3
|
+from tracim_backend.models.applications import applications
|
3
|
4
|
|
4
|
5
|
"""
|
5
|
6
|
Tests for /api/v2/system subpath endpoints.
|
|
@@ -24,41 +25,14 @@ class TestApplicationEndpoint(FunctionalTest):
|
24
|
25
|
)
|
25
|
26
|
res = self.testapp.get('/api/v2/system/applications', status=200)
|
26
|
27
|
res = res.json_body
|
27
|
|
- application = res[0]
|
28
|
|
- assert application['label'] == "Text Documents"
|
29
|
|
- assert application['slug'] == 'contents/html-document'
|
30
|
|
- assert application['fa_icon'] == 'file-text-o'
|
31
|
|
- assert application['hexcolor'] == '#3f52e3'
|
32
|
|
- assert application['is_active'] is True
|
33
|
|
- assert 'config' in application
|
34
|
|
- application = res[1]
|
35
|
|
- assert application['label'] == "Markdown Plus Documents"
|
36
|
|
- assert application['slug'] == 'contents/markdownpluspage'
|
37
|
|
- assert application['fa_icon'] == 'file-code-o'
|
38
|
|
- assert application['hexcolor'] == '#f12d2d'
|
39
|
|
- assert application['is_active'] is True
|
40
|
|
- assert 'config' in application
|
41
|
|
- application = res[2]
|
42
|
|
- assert application['label'] == "Files"
|
43
|
|
- assert application['slug'] == 'contents/file'
|
44
|
|
- assert application['fa_icon'] == 'paperclip'
|
45
|
|
- assert application['hexcolor'] == '#FF9900'
|
46
|
|
- assert application['is_active'] is True
|
47
|
|
- assert 'config' in application
|
48
|
|
- application = res[3]
|
49
|
|
- assert application['label'] == "Threads"
|
50
|
|
- assert application['slug'] == 'contents/thread'
|
51
|
|
- assert application['fa_icon'] == 'comments-o'
|
52
|
|
- assert application['hexcolor'] == '#ad4cf9'
|
53
|
|
- assert application['is_active'] is True
|
54
|
|
- assert 'config' in application
|
55
|
|
- application = res[4]
|
56
|
|
- assert application['label'] == "Calendar"
|
57
|
|
- assert application['slug'] == 'calendar'
|
58
|
|
- assert application['fa_icon'] == 'calendar'
|
59
|
|
- assert application['hexcolor'] == '#757575'
|
60
|
|
- assert application['is_active'] is True
|
61
|
|
- assert 'config' in application
|
|
28
|
+ assert len(res) == len(applications)
|
|
29
|
+ for counter, application in enumerate(applications):
|
|
30
|
+ assert res[counter]['label'] == application.label
|
|
31
|
+ assert res[counter]['slug'] == application.slug
|
|
32
|
+ assert res[counter]['fa_icon'] == application.fa_icon
|
|
33
|
+ assert res[counter]['hexcolor'] == application.hexcolor
|
|
34
|
+ assert res[counter]['is_active'] == application.is_active
|
|
35
|
+ assert res[counter]['config'] == application.config
|
62
|
36
|
|
63
|
37
|
def test_api__get_applications__err_401__unregistered_user(self):
|
64
|
38
|
"""
|