Started adding tests to tests for the models' integrity with GTFS

This commit is contained in:
Johannes Randerath
2024-06-27 13:01:56 +02:00
parent 7962ec4b6c
commit cf6fcda0ed
22 changed files with 943 additions and 180 deletions

View File

@@ -0,0 +1,279 @@
# Generated by Django 5.0.6 on 2024-06-26 21:33
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0008_alter_timeframe_service_id_alter_trip_service_id'),
]
operations = [
migrations.RenameField(
model_name='fareproduct',
old_name='curreny',
new_name='currency',
),
migrations.RemoveField(
model_name='bookingrule',
name='booking_rule_instructions',
),
migrations.RemoveField(
model_name='bookingrule',
name='end_time',
),
migrations.RemoveField(
model_name='bookingrule',
name='rule_criteria',
),
migrations.RemoveField(
model_name='bookingrule',
name='start_time',
),
migrations.RemoveField(
model_name='bookingrule',
name='trip_id',
),
migrations.RemoveField(
model_name='faremedium',
name='fare_media_description',
),
migrations.RemoveField(
model_name='fareproduct',
name='fare_product_description',
),
migrations.AddField(
model_name='attribution',
name='is_authority',
field=models.BooleanField(null=True),
),
migrations.AddField(
model_name='attribution',
name='is_operator',
field=models.BooleanField(null=True),
),
migrations.AddField(
model_name='attribution',
name='is_producer',
field=models.BooleanField(null=True),
),
migrations.AddField(
model_name='attribution',
name='organization_name',
field=models.CharField(default='Test', max_length=255),
preserve_default=False,
),
migrations.AddField(
model_name='bookingrule',
name='booking_url',
field=models.URLField(blank=True, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='drop_off_message',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='info_url',
field=models.URLField(blank=True, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='message',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='phone_number',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='pickup_message',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='prior_notice_duration_max',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='prior_notice_duration_min',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='prior_notice_last_day',
field=models.DateField(blank=True, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='prior_notice_last_time',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='prior_notice_service_id',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='prior_notice_start_day',
field=models.DateField(blank=True, null=True),
),
migrations.AddField(
model_name='bookingrule',
name='prior_notice_start_time',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='farelegrule',
name='leg_group_id',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='farelegrule',
name='rule_priority',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='faremedium',
name='fare_media_type',
field=models.IntegerField(choices=[('None', 0), ('Physical paper ticket that allows a passenger to take either a certain number of pre-purchased trips or unlimited trips within a fixed period of time', 1), ('Physical transit card that has stored tickets, passes or monetary value', 2), ('cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing', 3), ('Mobile app that have stored virtual transit cards, tickets, passes, or monetary value', 4)], default=1),
preserve_default=False,
),
migrations.AddField(
model_name='fareproduct',
name='fare_media_id',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='pt_map.faremedium'),
),
migrations.AddField(
model_name='faretransferrule',
name='duration_limit',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='faretransferrule',
name='duration_limit_type',
field=models.CharField(choices=[('Between the departure fare validation of the current leg and the arrival fare validation of the next leg', 0), ('Between the departure fare validation of the current leg and the departure fare validation of the next leg', 1), ('Between the arrival fare validation of the current leg and the departure fare validation of the next leg', 2), ('Between the arrival fare validation of the current leg and the arrival fare validation of the next leg', 3)], default=1, max_length=255),
preserve_default=False,
),
migrations.AddField(
model_name='faretransferrule',
name='fare_transfer_type',
field=models.CharField(choices=[('From-leg fare_leg_rules.fare_product_id plus fare_transfer_rules.fare_product_id; A + AB', 0), ('From-leg fare_leg_rules.fare_product_id plus fare_transfer_rules.fare_product_id plus to-leg fare_leg_rules.fare_product_id; A + AB + B', 1), ('fare_transfer_rules.fare_product_id; AB', 2)], default=1, max_length=255),
preserve_default=False,
),
migrations.AddField(
model_name='faretransferrule',
name='transfer_count',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='route',
name='network_id',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='stop',
name='tts_stop_name',
field=models.CharField(blank=True, max_length=255),
),
migrations.AddField(
model_name='stoptime',
name='continuous_drop_off',
field=models.IntegerField(choices=[('Continous stopping drop off', 0), ('No continuous stopping drop off', 1), ('Must phone agency to arrange continuous stopping drop off', 2), ('Must coordinate with driver to arrange continuous stopping drop off', 3)], default=1),
preserve_default=False,
),
migrations.AddField(
model_name='stoptime',
name='continuous_pickup',
field=models.IntegerField(choices=[('Continous stopping pickup', 0), ('No continuous stopping pickup', 1), ('Must phone agency to arrange continuous stopping pickup off', 2), ('Must coordinate with driver to arrange continuous stopping pickup', 3)], default=1),
preserve_default=False,
),
migrations.AddField(
model_name='stoptime',
name='drop_off_booking_rule_id',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stop_times_drop_off', to='pt_map.bookingrule'),
),
migrations.AddField(
model_name='stoptime',
name='end_pickup_drop_off_window',
field=models.CharField(blank=True, max_length=255),
),
migrations.AddField(
model_name='stoptime',
name='pickup_booking_rule_id',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stop_times_pickup', to='pt_map.bookingrule'),
),
migrations.AddField(
model_name='stoptime',
name='start_pickup_drop_off_window',
field=models.CharField(blank=True, max_length=255),
),
migrations.AddField(
model_name='translation',
name='field_value',
field=models.CharField(default='hi', max_length=255),
preserve_default=False,
),
migrations.AddField(
model_name='translation',
name='record_id',
field=models.CharField(default='rec1', max_length=255),
preserve_default=False,
),
migrations.AddField(
model_name='translation',
name='record_sub_id',
field=models.CharField(default='rec1', max_length=255),
preserve_default=False,
),
migrations.AlterField(
model_name='attribution',
name='attribution_name',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='bookingrule',
name='booking_type',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.RemoveField(
model_name='faretransferrule',
name='from_leg_group_id',
),
migrations.RemoveField(
model_name='faretransferrule',
name='to_leg_group_id',
),
migrations.AlterField(
model_name='route',
name='continuous_drop_off',
field=models.IntegerField(blank=True, choices=[('Continous stopping pickup', 0), ('No continuous stopping pickup', 1), ('Must phone agency to arrange continuous stopping pickup off', 2), ('Must coordinate with driver to arrange continuous stopping pickup', 3)], null=True),
),
migrations.AlterField(
model_name='route',
name='continuous_pickup',
field=models.IntegerField(blank=True, choices=[('Continous stopping pickup', 0), ('No continuous stopping pickup', 1), ('Must phone agency to arrange continuous stopping pickup off', 2), ('Must coordinate with driver to arrange continuous stopping pickup', 3)], null=True),
),
migrations.AlterField(
model_name='translation',
name='table_name',
field=models.CharField(choices=[('agency', 'agency'), ('stops', 'stops'), ('routes', 'routes'), ('trips', 'trips'), ('stop_times', 'stop_times'), ('pathways', 'pathways'), ('levels', 'levels'), ('feed_info', 'feed_info'), ('attributions', 'attributions')], max_length=255),
),
migrations.AddField(
model_name='faretransferrule',
name='from_leg_group_id',
field=models.ManyToManyField(blank=True, related_name='fare_transfer_rules_from', to='pt_map.farelegrule'),
),
migrations.AddField(
model_name='faretransferrule',
name='to_leg_group_id',
field=models.ManyToManyField(blank=True, related_name='fare_transfer_rules_to', to='pt_map.farelegrule'),
),
]

View File

@@ -0,0 +1,28 @@
# Generated by Django 5.0.6 on 2024-06-26 23:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0009_rename_curreny_fareproduct_currency_and_more'),
]
operations = [
migrations.AlterField(
model_name='route',
name='route_color',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AlterField(
model_name='route',
name='route_short_name',
field=models.CharField(max_length=255),
),
migrations.AlterField(
model_name='route',
name='route_text_color',
field=models.CharField(blank=True, max_length=10, null=True),
),
]

View File

@@ -0,0 +1,21 @@
# Generated by Django 5.0.6 on 2024-06-26 23:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0010_alter_route_route_color_alter_route_route_short_name_and_more'),
]
operations = [
migrations.RemoveField(
model_name='timeframe',
name='end_date',
),
migrations.RemoveField(
model_name='timeframe',
name='start_date',
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.0.6 on 2024-06-27 08:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0011_remove_timeframe_end_date_and_more'),
]
operations = [
migrations.RenameField(
model_name='fareproduct',
old_name='fare_product_id',
new_name='fare_product_pk',
),
]

View File

@@ -0,0 +1,23 @@
# Generated by Django 5.0.6 on 2024-06-27 08:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0012_rename_fare_product_id_fareproduct_fare_product_pk'),
]
operations = [
migrations.AddField(
model_name='fareproduct',
name='fare_product_id',
field=models.CharField(default='1', max_length=255),
preserve_default=False,
),
migrations.AlterUniqueTogether(
name='fareproduct',
unique_together={('fare_product_id', 'fare_media_id')},
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.0.6 on 2024-06-27 09:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0013_fareproduct_fare_product_id_and_more'),
]
operations = [
migrations.AlterField(
model_name='farelegrule',
name='network_id',
field=models.CharField(blank=True, max_length=255, null=True),
),
]

View File

@@ -0,0 +1,33 @@
# Generated by Django 5.0.6 on 2024-06-27 09:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0014_alter_farelegrule_network_id'),
]
operations = [
migrations.AlterField(
model_name='bookingrule',
name='prior_notice_last_day',
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='bookingrule',
name='prior_notice_last_time',
field=models.TimeField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='bookingrule',
name='prior_notice_start_day',
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='bookingrule',
name='prior_notice_start_time',
field=models.TimeField(blank=True, max_length=255, null=True),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.0.6 on 2024-06-27 09:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0015_alter_bookingrule_prior_notice_last_day_and_more'),
]
operations = [
migrations.AlterField(
model_name='attribution',
name='attribution_id',
field=models.CharField(max_length=255, primary_key=True, serialize=False),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.0.6 on 2024-06-27 09:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0016_alter_attribution_attribution_id'),
]
operations = [
migrations.AlterField(
model_name='fareattribute',
name='transfers',
field=models.IntegerField(blank=True, null=True),
),
]

View File

@@ -0,0 +1,23 @@
# Generated by Django 5.0.6 on 2024-06-27 10:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0017_alter_fareattribute_transfers'),
]
operations = [
migrations.AlterField(
model_name='stop',
name='stop_lat',
field=models.FloatField(blank=True, null=True),
),
migrations.AlterField(
model_name='stop',
name='stop_lon',
field=models.FloatField(blank=True, null=True),
),
]

View File

@@ -0,0 +1,19 @@
# Generated by Django 5.0.6 on 2024-06-27 10:51
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0018_alter_stop_stop_lat_alter_stop_stop_lon'),
]
operations = [
migrations.AlterField(
model_name='stoptime',
name='stop_id',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='pt_map.stop'),
),
]

View File

@@ -0,0 +1,29 @@
# Generated by Django 5.0.6 on 2024-06-27 10:55
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0019_alter_stoptime_stop_id'),
]
operations = [
migrations.AlterField(
model_name='stoptime',
name='continuous_pickup',
field=models.IntegerField(choices=[('Continous stopping pickup', 0), ('No continuous stopping pickup', 1), ('Must phone agency to arrange continuous stopping pickup off', 2), ('Must coordinate with driver to arrange continuous stopping pickup', 3)], null=True),
),
migrations.AlterField(
model_name='transfer',
name='from_stop_id',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='transfers_from_stop', to='pt_map.stop'),
),
migrations.AlterField(
model_name='transfer',
name='to_stop_id',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='transfers_to_stop', to='pt_map.stop'),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.0.6 on 2024-06-27 10:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pt_map', '0020_alter_stoptime_continuous_pickup_and_more'),
]
operations = [
migrations.AlterField(
model_name='stoptime',
name='continuous_drop_off',
field=models.IntegerField(choices=[('Continous stopping drop off', 0), ('No continuous stopping drop off', 1), ('Must phone agency to arrange continuous stopping drop off', 2), ('Must coordinate with driver to arrange continuous stopping drop off', 3)], null=True),
),
]