Skip to content

Commit

Permalink
django 1.9 to 2.1 compatibility (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
aclowes authored Oct 23, 2018
1 parent 2ea0774 commit 9cae425
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
9 changes: 3 additions & 6 deletions yawn/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ def setup_django():
"""Provide a test database and django configuration"""
from yawn.worker.models import Queue

# these are positional arguments, written out for clarity
verbosity = 1
interactive = False # whether to ask before deleting
old_config = runner.setup_databases(verbosity, interactive)
manager = runner.DiscoverRunner(verbosity=1, interactive=False)
old_config = manager.setup_databases()

# create the default queue outside the transaction
Queue.get_default_queue()

yield

for connection, old_name, destroy in old_config:
connection.creation.destroy_test_db(old_name)
manager.teardown_databases(old_config)


class TestPassedRollback(Exception):
Expand Down
9 changes: 4 additions & 5 deletions yawn/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.functions.base
import django.db.models.functions
import yawn.utilities.cron


Expand All @@ -23,7 +22,7 @@ class Migration(migrations.Migration):
('status', models.TextField(
choices=[('running', 'running'), ('succeeded', 'succeeded'), ('failed', 'failed'),
('killed', 'killed'), ('lost', 'lost')], default='running')),
('start_timestamp', models.DateTimeField(default=django.db.models.functions.base.Now)),
('start_timestamp', models.DateTimeField(default=django.db.models.functions.Now)),
('stop_timestamp', models.DateTimeField(null=True)),
('exit_code', models.IntegerField(null=True)),
('stdout', models.TextField(blank=True, default='')),
Expand Down Expand Up @@ -85,8 +84,8 @@ class Migration(migrations.Migration):
('name', models.TextField()),
('status', models.TextField(choices=[('active', 'active'), ('exited', 'exited'), ('lost', 'lost')],
default='active')),
('start_timestamp', models.DateTimeField(default=django.db.models.functions.base.Now)),
('last_heartbeat', models.DateTimeField(default=django.db.models.functions.base.Now)),
('start_timestamp', models.DateTimeField(default=django.db.models.functions.Now)),
('last_heartbeat', models.DateTimeField(default=django.db.models.functions.Now)),
],
),
migrations.CreateModel(
Expand Down

0 comments on commit 9cae425

Please sign in to comment.