Completed
Push — master ( 4f7ee6...646424 )
by Paolo
08:30 queued 06:53
created

uid.tests.test_commands   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 16
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A CommandsTestCase.test_truncate_uid_all() 0 6 1
A CommandsTestCase.test_initializedb() 0 6 1
A CommandsTestCase.test_truncate_uid() 0 6 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