Passed
Push — master ( bd2622...f167a9 )
by Paolo
06:51
created

TestCleanUpRegistration.test_cleanupregistration()   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nop 2
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
"""
4
Created on Mon Oct  7 12:37:21 2019
5
6
@author: Paolo Cozzi <[email protected]>
7
"""
8
9
from unittest.mock import patch
10
11
from django.test import TestCase
12
13
14
from ..tasks import clearsessions, cleanupregistration
15
16
17
class TestClearSession(TestCase):
18
    @patch('django.core.management.call_command')
19
    def test_clearsession(self, my_patch):
20
        result = clearsessions.run()
21
22
        self.assertEqual(result, "Sessions cleaned with success")
23
        self.assertTrue(my_patch.called)
24
25
26
class TestCleanUpRegistration(TestCase):
27
    @patch('django.core.management.call_command')
28
    def test_cleanupregistration(self, my_patch):
29
        result = cleanupregistration.run()
30
31
        self.assertEqual(result, "Registrations cleaned with success")
32
        self.assertTrue(my_patch.called)
33