Commit ca658632 authored by Florent Chehab's avatar Florent Chehab

Clean migrations to accelerate testings

Add new unit test that make it fail
parent f5858327
......@@ -3,6 +3,8 @@
from django import template
import yaml
from os.path import join, realpath, dirname
from backend.utils import read_file, write_file
############
# Need to do this first so that Django template engine is working
......@@ -20,16 +22,6 @@ django.setup()
##########
def read_file(file):
with open(file, "r") as myfile:
return myfile.read()
def write_file(file, data):
with open(file, 'w') as the_file:
the_file.write(data)
def render_and_save(template_path, context, output_path):
t = template.Template(read_file(template_path))
c = template.Context({'data': context})
......
This diff is collapsed.
# Generated by Django 2.0.3 on 2018-08-24 07:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='campus',
name='university',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='univ_campus', to='backend.University'),
),
]
This diff is collapsed.
# Generated by Django 2.0.3 on 2018-08-24 13:51
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0002_remove_content_type_name'),
('backend', '0003_auto_20180824_1011'),
]
operations = [
migrations.CreateModel(
name='PendingModeration',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('object_id', models.CharField(max_length=100)),
('content_object', django.contrib.postgres.fields.jsonb.JSONField()),
('delete', models.NullBooleanField(default=None)),
('approve', models.NullBooleanField(default=None)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
],
),
]
# Generated by Django 2.0.3 on 2018-08-24 13:53
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0004_pendingmoderation'),
]
operations = [
migrations.AlterField(
model_name='pendingmoderation',
name='content_object',
field=django.contrib.postgres.fields.jsonb.JSONField(default={}),
),
]
# Generated by Django 2.0.3 on 2018-08-24 13:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0005_auto_20180824_1553'),
]
operations = [
migrations.RenameField(
model_name='pendingmoderation',
old_name='content_object',
new_name='new_object',
),
]
# Generated by Django 2.0.3 on 2018-08-24 15:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0006_auto_20180824_1558'),
]
operations = [
migrations.RenameField(
model_name='pendingmoderation',
old_name='new_object',
new_name='object_to_moderate',
),
]
# Generated by Django 2.0.3 on 2018-08-24 19:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('backend', '0007_auto_20180824_1741'),
]
operations = [
migrations.RenameField(
model_name='pendingmoderation',
old_name='object_to_moderate',
new_name='new_object',
),
migrations.RemoveField(
model_name='pendingmoderation',
name='approve',
),
migrations.RemoveField(
model_name='pendingmoderation',
name='delete',
),
migrations.RemoveField(
model_name='university',
name='updated_at',
),
migrations.AddField(
model_name='university',
name='moderated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='moderated', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='university',
name='moderated_on',
field=models.DateTimeField(null=True),
),
migrations.AddField(
model_name='university',
name='updated_on',
field=models.DateTimeField(null=True),
),
migrations.AlterField(
model_name='campus',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='campusaccommodation',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='campuscultureandstudentlife',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='campusotherstuff',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='campustransport',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='cityotherstuff',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='cityphoto',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='citytourism',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='citytransport',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='countryculture',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='countrydri',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='countryhealthinsurance',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='countryotherinsurance',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='countryotherstuff',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='countryphoto',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='countryscholarship',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='countrytourism',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='countrytransport',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='countryvisaadministrative',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='university',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='updated', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='universitycourses',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='universityculture',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='universitydri',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='universityinfo',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='universityinsurance',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='universityotherstuff',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='universityphoto',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='universityscholarship',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='universitysemestersdates',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='universityspecialoffer',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
]
# Generated by Django 2.0.3 on 2018-08-24 20:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('backend', '0008_auto_20180824_2128'),
]
operations = [
migrations.AlterUniqueTogether(
name='pendingmoderation',
unique_together={('content_type', 'object_id')},
),
]
# Generated by Django 2.0.3 on 2018-08-24 20:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0009_auto_20180824_2218'),
]
operations = [
migrations.RenameField(
model_name='pendingmoderation',
old_name='author',
new_name='updated_by',
),
migrations.AddField(
model_name='pendingmoderation',
name='updated_on',
field=models.DateTimeField(null=True),
),
]
# Generated by Django 2.0.3 on 2018-08-25 16:49
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('backend', '0010_auto_20180824_2251'),
]
operations = [
migrations.CreateModel(
name='TestingModeration',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('do_not_touch_this_stuff', models.CharField(max_length=100)),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.AlterField(
model_name='university',
name='moderated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='university',
name='updated_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL),
),
]
# Generated by Django 2.0.3 on 2018-08-25 17:38
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('backend', '0011_auto_20180825_1849'),
]
operations = [
migrations.RenameModel(
old_name='TestingModeration',
new_name='ForTestingModeration',
),
]
# Generated by Django 2.0.3 on 2018-08-25 17:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0012_auto_20180825_1938'),
]
operations = [
migrations.RenameField(
model_name='fortestingmoderation',
old_name='do_not_touch_this_stuff',
new_name='aaa',
),
]
# Generated by Django 2.0.3 on 2018-08-26 08:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('backend', '0013_auto_20180825_1944'),
]
operations = [
migrations.CreateModel(
name='ForTestingVersionning',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('aaa', models.CharField(max_length=100)),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
]
# Generated by Django 2.0.3 on 2018-08-26 09:27
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0014_fortestingversionning'),
]
operations = [
migrations.RenameField(
model_name='fortestingversionning',
old_name='aaa',
new_name='bbb',
),
]
This diff is collapsed.
# Generated by Django 2.0.3 on 2018-08-27 07:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0016_auto_20180826_1556'),
]
operations = [
migrations.AddField(
model_name='userdata',
name='black_list',
field=models.ManyToManyField(related_name='_userdata_black_list_+', to='backend.University'),
),
]
# Generated by Django 2.0.3 on 2018-08-27 08:08
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0017_userdata_black_list'),
]
operations = [
migrations.RemoveField(
model_name='userdata',
name='is_anonymous',
),
migrations.RemoveField(
model_name='userdata',
name='is_public',
),
migrations.AlterField(
model_name='userdata',
name='contact_info',
field=django.contrib.postgres.fields.jsonb.JSONField(default={}, null=True),
),
]
# Generated by Django 2.0.3 on 2018-08-27 08:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0018_auto_20180827_1008'),
]
operations = [
migrations.AlterField(
model_name='userdata',
name='black_list',
field=models.ManyToManyField(blank=True, related_name='_userdata_black_list_+', to='backend.University'),
),
]
# Generated by Django 2.0.3 on 2018-08-27 08:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0019_auto_20180827_1010'),
]
operations = [
migrations.AlterField(
model_name='userdata',
name='owner',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]
# Generated by Django 2.0.3 on 2018-08-28 19:28
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('backend', '0020_auto_20180827_1026'),
]
operations = [
migrations.RenameModel(
old_name='ForTestingVersionning',
new_name='ForTestingVersioning',
),
]
# Generated by Django 2.0.3 on 2018-08-29 16:06
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('backend', '0021_auto_20180828_2128'),
]
operations = [
migrations.CreateModel(
name='Tag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('moderated_on', models.DateTimeField(null=True)),
('updated_on', models.DateTimeField(null=True)),
('name', models.CharField(max_length=100)),
('config', django.contrib.postgres.fields.jsonb.JSONField()),
('moderated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
]
# Generated by Django 2.0.3 on 2018-08-29 16:15
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0022_tag'),
]
operations = [
migrations.AlterField(
model_name='tag',
name='config',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict),
),
]
This diff is collapsed.
# Generated by Django 2.0.3 on 2018-08-29 19:01
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0024_auto_20180829_1840'),
]