Passed
Pull Request — master (#72)
by Paolo
16:34
created

CommandsTestCase.test_initializedb()   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
"""
4
Created on Thu May 17 17:25:22 2018
5
6
@author: Paolo Cozzi <[email protected]>
7
8
Testing management commands (https://stackoverflow.com/a/6513372)
9
10
"""
11
12
from django.core.management import call_command
13
from django.test import TestCase
14
15
16
class CommandsTestCase(TestCase):
17
    # TODO: need to define a custom settings.py
18
19
    def test_initializedb(self):
20
        " Test initializedb command."
21
22
        args = []
23
        opts = {}
24
        call_command('initializedb', *args, **opts)
25
26
    def test_truncate_uid(self):
27
        " Test initializedb command."
28
29
        args = []
30
        opts = {}
31
        call_command('truncate_image_tables', *args, **opts)
32
33
    def test_truncate_uid_all(self):
34
        " Test initializedb command."
35
36
        args = ["--all"]
37
        opts = {}
38
        call_command('truncate_image_tables', *args, **opts)
39