| Total Complexity | 3 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |