Passed
Pull Request — develop (#87)
by inkhey
01:32
created

backend.tracim_backend.tests.models.test_content_status   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 30
dl 0
loc 38
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A TestContentStatus.test_content_status__init__ok__nominal_case() 0 13 1
A TestContentStatus.test_content_status__is_editable__ok__nominal_case() 0 18 1
1
from tracim_backend.app_models.contents import ContentStatus, GlobalStatus
2
3
4
class TestContentStatus(object):
5
6
    def test_content_status__init__ok__nominal_case(self):
7
        status = ContentStatus(
8
            'open-test',
9
            GlobalStatus.OPEN.value,
10
            'Open-Test',
11
            'square-o',
12
            '#3f52e3'
13
        )
14
        assert status.slug == 'open-test'
15
        assert status.label == 'Open-Test'
16
        assert status.global_status == GlobalStatus.OPEN.value
17
        assert status.fa_icon == 'square-o'
18
        assert status.hexcolor == '#3f52e3'
19
20
    def test_content_status__is_editable__ok__nominal_case(self):
21
        status = ContentStatus(
22
            'open-test',
23
            GlobalStatus.OPEN.value,
24
            'Open-Test',
25
            'square-o',
26
            '#3f52e3'
27
        )
28
        assert status.is_editable() is True
29
30
        status2 = ContentStatus(
31
            'open-test',
32
            GlobalStatus.CLOSED.value,
33
            'Open-Test',
34
            'square-o',
35
            '#3f52e3'
36
        )
37
        assert status2.is_editable() is False