| Total Complexity | 2 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |