示例#1
0
    def test_accept_open_quote(self):
        """Test that an open quote can be accepted."""
        quote = QuoteFactory()
        assert not quote.accepted_on
        assert not quote.accepted_by

        contact = ContactFactory()

        with freeze_time('2017-07-12 13:00'):
            quote.accept(by=contact)

            quote.refresh_from_db()
            assert quote.accepted_on == now()
            assert quote.accepted_by == contact
示例#2
0
    def test_cancel_open_quote(self):
        """Test that an open quote can be cancelled."""
        quote = QuoteFactory()
        assert not quote.cancelled_on
        assert not quote.cancelled_by

        adviser = AdviserFactory()

        with freeze_time('2017-07-12 13:00'):
            quote.cancel(by=adviser)

            quote.refresh_from_db()
            assert quote.cancelled_on == now()
            assert quote.cancelled_by == adviser