Skip to content

Commit

Permalink
Test for missing migrations. Add the missing one.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Kaszynski committed Oct 10, 2018
1 parent 840cf58 commit acab171
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
20 changes: 20 additions & 0 deletions jwt_devices/migrations/0002_auto_20181010_2152.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-10 21:52
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('jwt_devices', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='device',
name='permanent_token',
field=models.CharField(max_length=255, unique=True),
),
]
26 changes: 10 additions & 16 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
def pytest_configure():
import django
from django.conf import settings
from django.core.management import call_command

settings.configure(
DEBUG_PROPAGATE_EXCEPTIONS=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:"
}
"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}
},
SITE_ID=1,
SECRET_KEY="not very secret in tests",
Expand All @@ -35,20 +33,17 @@ def pytest_configure():
"django.contrib.sites",
"django.contrib.messages",
"django.contrib.staticfiles",

"rest_framework",
"rest_framework_jwt",
"jwt_devices",
"tests",
),
PASSWORD_HASHERS=(
"django.contrib.auth.hashers.MD5PasswordHasher",
),
PASSWORD_HASHERS=("django.contrib.auth.hashers.MD5PasswordHasher",),
REST_FRAMEWORK={
"DEFAULT_AUTHENTICATION_CLASSES": [
"jwt_devices.authentication.PermanentTokenAuthentication"
]
}
},
)

try:
Expand All @@ -57,9 +52,7 @@ def pytest_configure():
except ImportError:
pass
else:
settings.INSTALLED_APPS += (
"oauth_provider",
)
settings.INSTALLED_APPS += ("oauth_provider",)

try:
if django.VERSION >= (1, 8):
Expand All @@ -69,13 +62,14 @@ def pytest_configure():
except ImportError:
pass
else:
settings.INSTALLED_APPS += (
"provider",
"provider.oauth2",
)
settings.INSTALLED_APPS += ("provider", "provider.oauth2")

try:
import django

django.setup()
except AttributeError:
pass

call_command("migrate")
call_command("makemigrations", "--dry-run", "--check")

0 comments on commit acab171

Please sign in to comment.