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.

ReservationFactory   A
last analyzed

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
rs 10
1
# -*- coding: utf-8 -*-
2
from datetime import time, datetime
3
import factory
4
5
from shoop.core.models import ProductType
6
from shoop.testing.factories import ProductFactory
7
8
from reservations.models import Reservation, ReservableProduct
9
10
11
class ReservableProductProductFactory(ProductFactory):
12
    @factory.lazy_attribute
13
    def type(self):
14
        return ProductType.objects.get_or_create(identifier="reservable")[0]
15
16
17
class ReservableProductFactory(factory.DjangoModelFactory):
18
    class Meta:
19
        model = ReservableProduct
20
21
    product = factory.SubFactory(ReservableProductProductFactory)
22
    check_out_time = time(hour=12)
23
    check_in_time = time(hour=15)
24
25
26
class ReservationFactory(factory.DjangoModelFactory):
27
    class Meta:
28
        model = Reservation
29
30
    reservable = factory.SubFactory(ReservableProductFactory)
31
    start_time = datetime(year=2015, month=6, day=30, hour=15)
32
    end_time = datetime(year=2015, month=7, day=5, hour=12)
33