transport-accessibility/transport_accessibility/pt_map/tests.py
Johannes Randerath f314bfb396 Got rid of bridge and fixed GTFS compliance
- Ported the bridge that was using a custom GTFS class and Pandas
  Dataframes to a native Django solution for and interface between db
  and csv (see api/io.py)
- Fixed some issues regarding the compliance of the exported csv files
  with the GTFS reference. I.e. now allowing times 24:00:00 <= t >=
  24:59:59
2024-06-24 14:21:53 +02:00

27 lines
2.0 KiB
Python

from django.test import TestCase
from pt_map.models import Agency, FeedInfo, Level, Stop, Route, Shape, Calendar, CalendarDate, LocationGroup, LocationGroupStop, LocationsGeojson, Trip, StopArea, StopTime, FareAttribute, FareLegRule, FareMedium, FareProduct, FareTransferRule, FareRule, Frequency, Transfer, Pathway, BookingRule, Translation, Attribution, Network, RouteNetwork, Area, Timeframe
from datetime import date, datetime
# Create your tests here.
class FeedInfoTestCase(TestCase):
def setUp(self):
FeedInfo.objects.create(feed_publisher_name="All fields", feed_publisher_url='example.com', feed_lang='pl', default_lang='pl', feed_start_date=datetime(2024, 1, 1), feed_end_date=datetime.now(), feed_version='1.0', feed_contact_email='me@example.com', feed_contact_url='example.com')
def test_ok(self):
FeedInfo.objects.get(feed_publisher_name="All fields")
FeedInfo.objects.get(feed_publisher_url='example.com')
FeedInfo.objects.get(feed_lang='pl')
FeedInfo.objects.get(default_lang='pl')
FeedInfo.objects.get(feed_start_date=datetime(2024, 1, 1))
FeedInfo.objects.get(feed_end_date=datetime.now())
FeedInfo.objects.get(feed_version='1.0')
FeedInfo.objects.get(feed_contact_email='me@example.com')
FeedInfo.objects.get(feed_contact_email='me@example.com')
class AgencyTestCase(TestCase):
def setUp(self):
FeedInfo.objects.create(feed_publisher_name="All fields", feed_publisher_url='example.com', feed_lang='pl', default_lang='pl', feed_start_date=datetime(2024, 1, 1), feed_end_date=datetime.now(), feed_version='1.0', feed_contact_email='me@example.com', feed_contact_url='example.com')
Agency.objects.create(agency_name='test', agency_url='example.com', agency_timezone='Europe/Berlin', agency_lang='pl', agency_phone='0123456574', agency_fare_url='example.com', agency_email='me@example.com', feed_info_id=FeedInfo.objects.get(feed_publisher_name="All fields"))
def test_ok(self):
print(Agency.objects.get(agency_name='test').feed_info_id.feed_id)