def test_export_routes_txt_minimal(self): Route.objects.create( feed=self.feed, route_id='AB', short_name='10', long_name='Airport - Bullfrog', rtype=3) routes_txt = Route.export_txt(self.feed) self.assertEqual(routes_txt, """\ route_id,route_short_name,route_long_name,route_type AB,10,Airport - Bullfrog,3 """)
def test_export_routes_txt_minimal(self): Route.objects.create(feed=self.feed, route_id='AB', short_name='10', long_name='Airport - Bullfrog', rtype=3) routes_txt = Route.export_txt(self.feed) self.assertEqual( routes_txt, """\ route_id,route_short_name,route_long_name,route_type AB,10,Airport - Bullfrog,3 """)
def test_export_routes_txt_maximal(self): agency = Agency.objects.create(feed=self.feed, agency_id='DTA') Route.objects.create( feed=self.feed, agency=agency, route_id='AB', short_name='10', long_name='Airport - Bullfrog', desc='Our Airport Route', rtype=3, url='http://example.com', color='00FFFF', text_color='000000') routes_txt = Route.export_txt(self.feed) self.assertEqual(routes_txt, """\ route_id,agency_id,route_short_name,route_long_name,route_desc,route_type,\ route_url,route_color,route_text_color AB,DTA,10,Airport - Bullfrog,Our Airport Route,3,http://example.com,\ 00FFFF,000000 """)
def test_export_routes_txt_maximal(self): agency = Agency.objects.create(feed=self.feed, agency_id='DTA') Route.objects.create(feed=self.feed, agency=agency, route_id='AB', short_name='10', long_name='Airport - Bullfrog', desc='Our Airport Route', rtype=3, url='http://example.com', color='00FFFF', text_color='000000') routes_txt = Route.export_txt(self.feed) self.assertEqual( routes_txt, """\ route_id,agency_id,route_short_name,route_long_name,route_desc,route_type,\ route_url,route_color,route_text_color AB,DTA,10,Airport - Bullfrog,Our Airport Route,3,http://example.com,\ 00FFFF,000000 """)
def test_export_routes_txt_none(self): routes_txt = Route.export_txt(self.feed) self.assertFalse(routes_txt)