示例#1
0
    def test_export_fare_attributes_minimal(self):
        Fare.objects.create(
            feed=self.feed, fare_id='p', price='1.25', currency_type='USD',
            payment_method=0, transfers=0)
        fare = Fare.objects.get()
        fare_txt = Fare.export_txt(self.feed)
        self.assertEqual(fare_txt, """\
fare_id,price,currency_type,payment_method,transfers
p,%s,USD,0,0
""" % fare.price)
示例#2
0
    def test_export_fare_attributes_unlimited_transfers(self):
        Fare.objects.create(
            feed=self.feed, fare_id='p', price='1.25', currency_type='USD',
            payment_method=0, transfers=None, transfer_duration=3600)
        fare = Fare.objects.get()
        fare_txt = Fare.export_txt(self.feed)
        self.assertEqual(fare_txt, """\
fare_id,price,currency_type,payment_method,transfers,transfer_duration
p,%s,USD,0,,3600
""" % fare.price)
示例#3
0
    def test_export_fare_attributes_minimal(self):
        Fare.objects.create(feed=self.feed,
                            fare_id='p',
                            price='1.25',
                            currency_type='USD',
                            payment_method=0,
                            transfers=0)
        fare = Fare.objects.get()
        fare_txt = Fare.export_txt(self.feed)
        self.assertEqual(
            fare_txt, """\
fare_id,price,currency_type,payment_method,transfers
p,%s,USD,0,0
""" % fare.price)
示例#4
0
    def test_export_fare_attributes_unlimited_transfers(self):
        Fare.objects.create(feed=self.feed,
                            fare_id='p',
                            price='1.25',
                            currency_type='USD',
                            payment_method=0,
                            transfers=None,
                            transfer_duration=3600)
        fare = Fare.objects.get()
        fare_txt = Fare.export_txt(self.feed)
        self.assertEqual(
            fare_txt, """\
fare_id,price,currency_type,payment_method,transfers,transfer_duration
p,%s,USD,0,,3600
""" % fare.price)