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.
Completed
Push — master ( 0fa676...0b5929 )
by Jason
01:10
created

setUp()   A

Complexity

Conditions 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 3
dl 0
loc 10
rs 9.4286
1
import datetime
2
3
from django.test import RequestFactory
4
5
from kakaravaara.tests import KakaravaaraTestsBase
6
from reservable_pricing.factories import PeriodPriceModifierFactory
7
from reservations.factories import ReservableProductFactory
8
from shoop.core.models import ShopProduct
9
10
11
class ReservablePricingModulePeriodModifiersTestCase(KakaravaaraTestsBase):
12
13
    def setUp(self):
14
        super(ReservablePricingModulePeriodModifiersTestCase, self).setUp()
15
        self.reservable = ReservableProductFactory()
16
        self.product = self.reservable.product
17
        self.modifier = PeriodPriceModifierFactory(product=self.product)
18
        # Verify factories
19
        assert self.modifier.start_date == datetime.date(2015, 11, 1)
20
        assert self.modifier.end_date == datetime.date(2015, 11, 30)
21
        self.request = RequestFactory().get("/")
22
        self.request.shop = self.shop
23
24
    def test_get_price_info_returns_correct_price_with_no_modifiers(self):
25
        shop_product = ShopProduct.objects.get(product=self.reservable.product, shop=self.shop)
26
        self.assertEqual(self.reservable.product.get_price(
1 ignored issue
show
Bug introduced by
The Instance of ReservablePricingModulePeriodModifiersTestCase does not seem to have a member named assertEqual.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
27
            self.request, quantity=2).value, shop_product.default_price_value * 2
28
        )
29
30
    def test_get_price_info_returns_correct_price_with_dates_outside_modifiers(self):
31
        shop_product = ShopProduct.objects.get(product=self.reservable.product, shop=self.shop)
32
        self.request.GET = {
33
            "start": "2015-10-01",
34
            "end": "2015-10-03",
35
        }
36
        self.assertEqual(
1 ignored issue
show
Bug introduced by
The Instance of ReservablePricingModulePeriodModifiersTestCase does not seem to have a member named assertEqual.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
37
            self.reservable.product.get_price(self.request, quantity=2).value, shop_product.default_price_value * 2
38
        )
39
40
    def test_get_price_info_returns_correct_price_with_modifiers(self):
41
        shop_product = ShopProduct.objects.get(product=self.reservable.product, shop=self.shop)
42
        self.request.GET = {
43
            "start": "2015-11-01",
44
            "end": "2015-11-03",
45
        }
46
        expected_price = shop_product.default_price_value * 2 + self.modifier.modifier * 2
47
        self.assertEqual(self.reservable.product.get_price(self.request, quantity=2).value, expected_price)
1 ignored issue
show
Bug introduced by
The Instance of ReservablePricingModulePeriodModifiersTestCase does not seem to have a member named assertEqual.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
48
49
    def test_get_price_info_returns_correct_price_with_start_before_modifiers(self):
50
        shop_product = ShopProduct.objects.get(product=self.reservable.product, shop=self.shop)
51
        self.request.GET = {
52
            "start": "2015-10-30",
53
            "end": "2015-11-02",
54
        }
55
        expected_price = shop_product.default_price_value * 3 + self.modifier.modifier
56
        self.assertEqual(self.reservable.product.get_price(self.request, quantity=3).value, expected_price)
1 ignored issue
show
Bug introduced by
The Instance of ReservablePricingModulePeriodModifiersTestCase does not seem to have a member named assertEqual.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
57
58
    def test_get_price_info_returns_correct_price_with_end_after_modifiers(self):
59
        shop_product = ShopProduct.objects.get(product=self.reservable.product, shop=self.shop)
60
        self.request.GET = {
61
            "start": "2015-11-30",
62
            "end": "2015-12-03",
63
        }
64
        expected_price = shop_product.default_price_value * 3 + self.modifier.modifier
65
        self.assertEqual(self.reservable.product.get_price(self.request, quantity=3).value, expected_price)
1 ignored issue
show
Bug introduced by
The Instance of ReservablePricingModulePeriodModifiersTestCase does not seem to have a member named assertEqual.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
66