Пример #1
0
    def test_waitlisted_dealer_not_app(self):
        session = Session().session
        with request_cached_context():
            session.add(Group(tables=1, cost=10, status=c.WAITLISTED))
            session.commit()

        assert c.DEALER_APPS == 0
Пример #2
0
    def test_not_a_dealer_no_app(self):
        session = Session().session
        with request_cached_context():
            session.add(Group(tables=0, cost=10, status=c.UNAPPROVED))
            session.commit()

        assert c.DEALER_APPS == 0
Пример #3
0
    def test_free_dealer_no_app(self):
        session = Session().session
        with request_cached_context():
            session.add(Group(tables=1, cost=0, auto_recalc=False, status=c.UNAPPROVED))
            session.commit()

        assert c.DEALER_APPS == 0
Пример #4
0
    def test_free_badge_no_price_bump(self):
        session = Session().session
        assert c.BADGES_SOLD == 0

        with request_cached_context():
            session.add(Attendee(paid=c.NEED_NOT_PAY, badge_status=c.COMPLETED_STATUS))
            session.commit()

        assert c.BADGES_SOLD == 0
        assert 40 == c.get_attendee_price()
Пример #5
0
    def test_invalid_badge_no_price_bump(self):
        session = Session().session
        assert c.BADGES_SOLD == 0

        with request_cached_context():
            session.add(Attendee(paid=c.HAS_PAID, badge_status=c.INVALID_STATUS))
            session.commit()

        assert c.BADGES_SOLD == 0
        assert 40 == c.get_attendee_price()
Пример #6
0
    def test_refunded_badge_price_bump_before_event(self, monkeypatch):
        monkeypatch.setattr(c, 'EPOCH', localized_now() + timedelta(days=1))
        session = Session().session
        assert c.BADGES_SOLD == 0

        with request_cached_context():
            session.add(Attendee(paid=c.REFUNDED, badge_status=c.COMPLETED_STATUS))
            session.commit()

        assert c.BADGES_SOLD == 1
        assert 50 == c.get_attendee_price()
Пример #7
0
    def test_over_limit_price_bump_during_event(self, monkeypatch):
        monkeypatch.setattr(c, 'EPOCH', localized_now() - timedelta(days=1))

        session = Session().session
        assert c.BADGES_SOLD == 0

        with request_cached_context():
            session.add(Attendee(paid=c.HAS_PAID, badge_status=c.COMPLETED_STATUS))
            session.commit()

        assert c.BADGES_SOLD == 1
        assert 40 == c.get_attendee_price()