Example #1
0
    def test_mixed_standard_and_reduced_tariff(self):
        start = parse('01-01-2018 21:57:13Z')
        end = parse('01-01-2018 22:10:56Z')
        record = CallRecord(started_at=start,
                            ended_at=end,
                            call_id=uuid.uuid4())
        record.save()

        assert record.price == 0.36 + 0.09 * 2
Example #2
0
    def test_standard_call_charges_standing_and_minutely(self):
        start = parse('01-01-2018 20:55:13Z')
        end = parse('01-01-2018 20:58:56Z')
        record = CallRecord(started_at=start,
                            ended_at=end,
                            call_id=uuid.uuid4())
        record.save()

        assert record.price == 0.36 + 0.09 * 3
Example #3
0
    def test_calculates_duration(self):
        start = parse('01-01-2018 16:00Z')
        end = parse('01-01-2018 16:30Z')
        record = CallRecord(started_at=start,
                            ended_at=end,
                            call_id=uuid.uuid4())
        record.save()

        assert record.duration == timedelta(minutes=30)
Example #4
0
    def test_reduced_tariff_charges_only_standing_charge(self):
        start = parse('01-01-2018 22:57:13Z')
        end = parse('01-01-2018 23:10:56Z')
        record = CallRecord(started_at=start,
                            ended_at=end,
                            call_id=uuid.uuid4())
        record.save()

        assert record.price == 0.36
Example #5
0
    def test_record_creation(self):
        record = CallRecord()
        record.save()

        assert record.id