-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #644 from FJNR-inc/develop
New release
- Loading branch information
Showing
54 changed files
with
2,428 additions
and
2,291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from rest_framework.test import APITestCase | ||
|
||
|
||
class CustomAPITestCase(APITestCase): | ||
ATTRIBUTES = [] | ||
|
||
def check_attributes(self, content, attrs=None): | ||
if attrs is None: | ||
attrs = self.ATTRIBUTES | ||
|
||
missing_keys = list(set(attrs) - set(content.keys())) | ||
extra_keys = list(set(content.keys()) - set(attrs)) | ||
self.assertEqual( | ||
len(missing_keys), | ||
0, | ||
'You miss some attributes: ' + str(missing_keys) | ||
) | ||
self.assertEqual( | ||
len(extra_keys), | ||
0, | ||
'You have some extra attributes: ' + str(extra_keys) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Generated by Django 2.2.12 on 2020-07-20 15:27 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
from django.conf import settings | ||
import simple_history.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('contenttypes', '0002_remove_content_type_name'), | ||
('retirement', '0028_auto_20200601_1613'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='RetreatType', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=253, verbose_name='Name')), | ||
( | ||
'name_en', | ||
models.CharField( | ||
max_length=253, | ||
null=True, | ||
verbose_name='Name', | ||
) | ||
), | ||
( | ||
'name_fr', | ||
models.CharField( | ||
max_length=253, | ||
null=True, | ||
verbose_name='Name', | ||
) | ||
), | ||
('minutes_before_display_link', models.IntegerField(verbose_name='Minute before displaying the link')), | ||
], | ||
options={ | ||
'verbose_name': 'Type of retreat', | ||
'verbose_name_plural': 'Types of retreat', | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='historicalretreat', | ||
name='type_new', | ||
field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='retirement.RetreatType'), | ||
), | ||
migrations.AddField( | ||
model_name='retreat', | ||
name='type_new', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='retirement.RetreatType'), | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalRetreatType', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, | ||
db_index=True, verbose_name='ID')), | ||
( | ||
'name', models.CharField(max_length=253, verbose_name='Name')), | ||
('name_fr', models.CharField(max_length=253, null=True, | ||
verbose_name='Name')), | ||
('name_en', models.CharField(max_length=253, null=True, | ||
verbose_name='Name')), | ||
('minutes_before_display_link', models.IntegerField( | ||
verbose_name='Minute before displaying the link')), | ||
('history_id', | ||
models.AutoField(primary_key=True, serialize=False)), | ||
('history_date', models.DateTimeField()), | ||
('history_change_reason', | ||
models.CharField(max_length=100, null=True)), | ||
('history_type', models.CharField( | ||
choices=[('+', 'Created'), ('~', 'Changed'), | ||
('-', 'Deleted')], max_length=1)), | ||
('history_user', models.ForeignKey(null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name='+', | ||
to=settings.AUTH_USER_MODEL)), | ||
], | ||
options={ | ||
'verbose_name': 'historical Type of retreat', | ||
'ordering': ('-history_date', '-history_id'), | ||
'get_latest_by': 'history_date', | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Generated by Django 2.2.12 on 2020-07-20 15:17 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
def migrate_type_of_retreat(apps, schema_editor): | ||
Retreat = apps.get_model('retirement', 'Retreat') | ||
RetreatType = apps.get_model('retirement', 'RetreatType') | ||
|
||
physical, created = RetreatType.objects.get_or_create( | ||
name_fr='Physique', | ||
name_en='Physical', | ||
minutes_before_display_link=0 | ||
) | ||
|
||
virtual, created = RetreatType.objects.get_or_create( | ||
name_fr='Virtuelle', | ||
name_en='Virtual', | ||
minutes_before_display_link=30 | ||
) | ||
|
||
for retreat in Retreat.objects.all(): | ||
if retreat.type == 'V': | ||
retreat.type_new = virtual | ||
else: | ||
retreat.type_new = physical | ||
|
||
retreat.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('contenttypes', '0002_remove_content_type_name'), | ||
('retirement', '0029_auto_20200720_1127'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(migrate_type_of_retreat), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 2.2.12 on 2020-07-20 15:35 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('retirement', '0030_migration_of_retreat_type'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='historicalretreat', | ||
name='type', | ||
), | ||
migrations.RemoveField( | ||
model_name='retreat', | ||
name='type', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 2.2.12 on 2020-07-20 15:59 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('retirement', '0031_auto_20200720_1135'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='historicalretreat', | ||
old_name='type_new', | ||
new_name='type', | ||
), | ||
migrations.RenameField( | ||
model_name='retreat', | ||
old_name='type_new', | ||
new_name='type', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 2.2.12 on 2020-07-20 16:02 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('retirement', '0032_auto_20200720_1159'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='retreat', | ||
name='type', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='retreats', to='retirement.RetreatType'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Generated by Django 2.2.12 on 2020-07-20 17:39 | ||
|
||
from django.conf import settings | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('retirement', '0033_auto_20200720_1202'), | ||
] | ||
|
||
operations = [] |
Oops, something went wrong.