mirror of
https://github.com/jazzband/django-axes.git
synced 2026-04-12 11:11:05 +00:00
Merge pull request #365 from markddavidoff/add-missing-migrations
Bug: Add missing migrations
This commit is contained in:
commit
ce62cd35fa
4 changed files with 99 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
|||
Changes
|
||||
=======
|
||||
|
||||
4.4.1 (2018-10-18)
|
||||
4.4.1 (2018-10-24)
|
||||
------------------
|
||||
|
||||
- Add a German translation
|
||||
|
|
@ -16,6 +16,9 @@ Changes
|
|||
- pin prospector to 0.12.11, and pin astroid to 1.6.5
|
||||
[hsiaoyi0504]
|
||||
|
||||
- fix missing migration and add check to prevent it happening again.
|
||||
[markddavidoff]
|
||||
|
||||
4.4.0 (2018-05-26)
|
||||
------------------
|
||||
|
||||
|
|
|
|||
58
axes/migrations/0004_auto_20181024_1538.py
Normal file
58
axes/migrations/0004_auto_20181024_1538.py
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.16 on 2018-10-24 22:38
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('axes', '0003_auto_20160322_0929'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='accessattempt',
|
||||
options={'verbose_name': 'access attempt', 'verbose_name_plural': 'access attempts'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='accesslog',
|
||||
options={'verbose_name': 'access log', 'verbose_name_plural': 'access logs'},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='accessattempt',
|
||||
name='attempt_time',
|
||||
field=models.DateTimeField(auto_now_add=True, verbose_name='Attempt Time'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='accessattempt',
|
||||
name='user_agent',
|
||||
field=models.CharField(db_index=True, max_length=255, verbose_name='User Agent'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='accessattempt',
|
||||
name='username',
|
||||
field=models.CharField(db_index=True, max_length=255, null=True, verbose_name='Username'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='accesslog',
|
||||
name='attempt_time',
|
||||
field=models.DateTimeField(auto_now_add=True, verbose_name='Attempt Time'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='accesslog',
|
||||
name='logout_time',
|
||||
field=models.DateTimeField(blank=True, null=True, verbose_name='Logout Time'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='accesslog',
|
||||
name='user_agent',
|
||||
field=models.CharField(db_index=True, max_length=255, verbose_name='User Agent'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='accesslog',
|
||||
name='username',
|
||||
field=models.CharField(db_index=True, max_length=255, null=True, verbose_name='Username'),
|
||||
),
|
||||
]
|
||||
27
axes/tests/test_models.py
Normal file
27
axes/tests/test_models.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from django.test import TestCase
|
||||
|
||||
|
||||
class MigrationsCheck(TestCase):
|
||||
def setUp(self):
|
||||
from django.utils import translation
|
||||
self.saved_locale = translation.get_language()
|
||||
translation.deactivate_all()
|
||||
|
||||
def tearDown(self):
|
||||
if self.saved_locale is not None:
|
||||
from django.utils import translation
|
||||
translation.activate(self.saved_locale)
|
||||
|
||||
def test_missing_migrations(self):
|
||||
from django.db import connection
|
||||
from django.apps.registry import apps
|
||||
from django.db.migrations.executor import MigrationExecutor
|
||||
executor = MigrationExecutor(connection)
|
||||
from django.db.migrations.autodetector import MigrationAutodetector
|
||||
from django.db.migrations.state import ProjectState
|
||||
autodetector = MigrationAutodetector(
|
||||
executor.loader.project_state(),
|
||||
ProjectState.from_apps(apps),
|
||||
)
|
||||
changes = autodetector.changes(graph=executor.loader.graph)
|
||||
self.assertEqual({}, changes)
|
||||
10
manage.py
Normal file
10
manage.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env python
|
||||
import os
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "axes.test_settings")
|
||||
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
execute_from_command_line(sys.argv)
|
||||
Loading…
Reference in a new issue