GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

GetOrderDetailsForNotifyEventsTestCase.setUp()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
1
from mock import Mock
2
3
from kakaravaara.tests import KakaravaaraTestsBase
4
from reservations.notify_events import get_order_details
5
6
7
class LinesMock(Mock):
8
    def filter(self, type=None):
9
        return [Mock(
10
            text="Cool cottage",
11
            product=Mock(
12
                type=Mock(
13
                    identifier="reservable"
14
                )
15
            ),
16
            extra_data={
17
                "reservation_start": "2016-01-01",
18
                "persons": 3,
19
            },
20
            quantity=4,
21
        )]
22
23
24
class GetOrderDetailsForNotifyEventsTestCase(KakaravaaraTestsBase):
25
    def setUp(self):
26
        super(GetOrderDetailsForNotifyEventsTestCase, self).setUp()
27
        self.order = Mock(
28
            lines=LinesMock()
29
        )
30
31
    def test_correct_string_is_returned(self):
32
        self.assertEqual(
33
            get_order_details(self.order),
34
            "Cool cottage\n"
35
            "    4 nights, 3 persons, 2016-01-01 - 2016-01-05"
36
        )
37