예제 #1
0
    def create_factories(self):
        ConfigFactory.create()

        self.processor = UserFactory.create()

        self.user = UserFactory()
        self.user_no_room = UserFactory(room=None, address=AddressFactory())
        self.room = RoomFactory()
예제 #2
0
    def create_factories(self):
        ConfigFactory.create()

        self.processor = UserFactory.create()

        self.last_month_last = session.utcnow().replace(day=1) - timedelta(1)
        self.last_month_last_date = self.last_month_last.date()

        self.membership_fee_last = MembershipFeeFactory.create(
            begins_on=self.last_month_last_date.replace(day=1),
            ends_on=self.last_month_last_date)

        payment_deadline = timedelta(14)
        payment_deadline_final = timedelta(62)

        no_pid_action_date = session.utcnow() - payment_deadline + timedelta(1)
        pid_state_date = no_pid_action_date - timedelta(1)
        pid_no_end_membership_date = session.utcnow(
        ) - payment_deadline_final + timedelta(1)
        pid_end_membership_date = pid_no_end_membership_date - timedelta(1)

        self.membership_fee_no_pid_action = MembershipFeeFactory.create(
            begins_on=no_pid_action_date,
            ends_on=no_pid_action_date,
            booking_begin=timedelta(1),
            booking_end=timedelta(1),
        )

        self.membership_fee_pid_state = MembershipFeeFactory.create(
            begins_on=pid_state_date,
            ends_on=pid_state_date,
            booking_begin=timedelta(1),
            booking_end=timedelta(1),
        )

        self.membership_fee_no_end_membership = MembershipFeeFactory.create(
            begins_on=pid_no_end_membership_date,
            ends_on=pid_no_end_membership_date,
            booking_begin=timedelta(1),
            booking_end=timedelta(1),
        )

        self.membership_fee_pid_end_membership = MembershipFeeFactory.create(
            begins_on=pid_end_membership_date,
            ends_on=pid_end_membership_date,
            booking_begin=timedelta(1),
            booking_end=timedelta(1),
        )
예제 #3
0
 def create_factories(self):
     self.login = '******'
     self.password = '******'
     self.admin = UserFactory(login=self.login, password=self.password)
     admin_group = AdminPropertyGroupFactory()
     MembershipFactory.create(user=self.admin, group=admin_group)
     self.config = ConfigFactory()
예제 #4
0
    def create_factories(self):
        ConfigFactory.create()

        self.user = UserFactory.create()

        self.user_membership = MembershipFactory.create(
            active_during=closedopen(session.utcnow() - timedelta(weeks=52),
                                     None),
            user=self.user,
            group=config.member_group)

        last_month_last = session.utcnow().date().replace(day=1) - timedelta(1)

        self.membership_fee_current = MembershipFeeFactory.create()
        self.membership_fee_last = MembershipFeeFactory.create(
            begins_on=last_month_last.replace(day=1), ends_on=last_month_last)
예제 #5
0
파일: test_models.py 프로젝트: d3vv3/pydo
 def setup(self, session):
     self.dummy_instance = ConfigFactory.create()
     self.model = Config(
         id=self.dummy_instance.id,
         default=self.dummy_instance.default,
         user=self.dummy_instance.user,
         description=self.dummy_instance.description,
         choices=self.dummy_instance.choices,
     )
     self.model_attributes = [
         'id',
         'default',
         'user',
         'description',
         'choices',
     ]
예제 #6
0
 def create_factories(self):
     self.config = ConfigFactory.create()