Passed
Push — master ( e32157...9a4845 )
by Alexander
04:03
created

TestCheckUnappliedMigrationsMiddleware.test_unapplied_migrations()   A

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
import os
2
import unittest
3
from django import test
4
from django.core.management import call_command
5
6
7
@unittest.skipUnless(
8
    os.getenv('TEST_CHECK_UNAPPLIED_MIGRATIONS_MIDDLEWARE'),
9
    'CheckUnappliedMigrationsMiddleware testing not enabled')
10
class TestCheckUnappliedMigrationsMiddleware(test.TransactionTestCase):
11
    def test_unapplied_migrations(self):
12
        call_command('migrate', 'bugs', 'zero', verbosity=2, interactive=False)
13
        unapplied_migration_message = 'unapplied migration(s). See '\
14
            '<a href="https://kiwitcms.readthedocs.io/en/latest/'\
15
            'installing_docker.html#initial-configuration-of-running-'\
16
            'container">documentation</a>'
17
        response = self.client.get('/', follow=True)
18
        self.assertContains(response, unapplied_migration_message)
19