diff options
author | 2019-10-07 08:59:23 +0200 | |
---|---|---|
committer | 2019-10-08 01:09:40 +0200 | |
commit | cf1a0755580b109d5f35331b6d5cbfef0d92fa97 (patch) | |
tree | 8f7771077b8314635b52aa47c050d58102b03341 /pydis_site/wsgi.py | |
parent | Add validation rules to Infraction serializer (diff) |
Migrate undesirable active infraction to inactive
https://github.com/python-discord/site/issues/273
This commit adds a data migration to migrate active infractions that
should not be active to inactive. There are two types of infractions
that this migration will migrate to inactive:
- Infractions of types that should never be active (e.g. notes)
- Secondary active infractions if a given user already has an active
infraction of the same type.
Since this makes the migration file fairly complex, I have written
tests to make sure the migration works as expected. In order to do
this, I've subclassed `django.test.TestCase` to create a
`MigrationsTestCase` that takes care of reverting the database back
to a state prior to the migrations we want to test and injects test
data before applying the migrations we want to test.
For more information, see `pydis_site.apps.api.tests.migrations.base`
This implements the last part of and closes #273
Diffstat (limited to 'pydis_site/wsgi.py')
0 files changed, 0 insertions, 0 deletions