Skip to content

Commit

Permalink
[#109] Skip migrating status test if django version is greater than 2
Browse files Browse the repository at this point in the history
  • Loading branch information
javrasya committed Nov 17, 2019
1 parent 3ee2951 commit d8de17f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion river/tests/tmigrations/test__migrations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import sys
from unittest import skipUnless

import django
from django.contrib.contenttypes.models import ContentType
from django.db import connection
from django.test.utils import override_settings
Expand Down Expand Up @@ -86,6 +88,7 @@ def test__shouldNotKeepRecreatingMigrationsWhenNoChange(self):
assert_that(self.migrations_after, has_length(len(self.migrations_before)))

@override_settings(MIGRATION_MODULES={"tests": "river.tests.volatile.river_tests"})
@skipUnless(django.VERSION[0] < 2, "Is not able to run with new version of django")
def test__shouldMigrateTransitionApprovalStatusToStringInDB(self):
out = StringIO()
sys.stout = out
Expand Down Expand Up @@ -114,7 +117,7 @@ def test__shouldMigrateTransitionApprovalStatusToStringInDB(self):
result = cur.execute("select status from river_transitionapproval where object_id=%s;" % workflow_object.model.pk).fetchall()
assert_that(result[0][0], equal_to(0))

call_command('migrate', 'river', stdout=out)
call_command('migrate', 'river', '0005', stdout=out)

with connection.cursor() as cur:
schema = cur.execute("PRAGMA table_info('river_transitionapproval');").fetchall()
Expand Down

0 comments on commit d8de17f

Please sign in to comment.