mirror of https://github.com/snachodog/mybuddy.git
Fix and re-enable the reset management command test.
Not 100% sure of why this fixes the issue - it appears that changes to django.test.TestCase in Django 2.0 led to the test failing.
This commit is contained in:
parent
2c09749217
commit
1fa3c49f69
|
@ -1,14 +1,14 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TransactionTestCase
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
|
|
||||||
from core.models import Child
|
from core.models import Child
|
||||||
|
|
||||||
|
|
||||||
class CommandsTestCase(TestCase):
|
class CommandsTestCase(TransactionTestCase):
|
||||||
def test_migrate(self):
|
def test_migrate(self):
|
||||||
call_command('migrate', verbosity=0)
|
call_command('migrate', verbosity=0)
|
||||||
self.assertIsInstance(User.objects.get(username='admin'), User)
|
self.assertIsInstance(User.objects.get(username='admin'), User)
|
||||||
|
@ -20,7 +20,7 @@ class CommandsTestCase(TestCase):
|
||||||
call_command('fake', children=2, days=7, verbosity=0)
|
call_command('fake', children=2, days=7, verbosity=0)
|
||||||
self.assertEqual(Child.objects.count(), 3)
|
self.assertEqual(Child.objects.count(), 3)
|
||||||
|
|
||||||
"""def test_reset(self):
|
def test_reset(self):
|
||||||
call_command('reset', verbosity=0, interactive=False)
|
call_command('reset', verbosity=0, interactive=False)
|
||||||
self.assertIsInstance(User.objects.get(username='admin'), User)
|
self.assertIsInstance(User.objects.get(username='admin'), User)
|
||||||
self.assertEqual(Child.objects.count(), 1)"""
|
self.assertEqual(Child.objects.count(), 1)
|
||||||
|
|
Loading…
Reference in New Issue