FeedbackManagerTest.test_get_size()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 11
rs 9.4285
1
# coding: utf8
2
3
"""
4
This software is licensed under the Apache 2 license, quoted below.
5
6
Copyright 2014 Crystalnix Limited
7
8
Licensed under the Apache License, Version 2.0 (the "License"); you may not
9
use this file except in compliance with the License. You may obtain a copy of
10
the License at
11
12
    http://www.apache.org/licenses/LICENSE-2.0
13
14
Unless required by applicable law or agreed to in writing, software
15
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17
License for the specific language governing permissions and limitations under
18
the License.
19
"""
20
21
from django.test import TestCase
22
23
from feedback.models import Feedback
24
from feedback.factories import FeedbackFactory
25
26
27
class FeedbackManagerTest(TestCase):
28
    def test_get_size(self):
29
        screenshot_size = 10
30
        blackbox_size = 20
31
        attached_file_size = 30
32
        system_logs_size = 40
33
        FeedbackFactory.create_batch(10, screenshot_size=screenshot_size,
34
                                     blackbox_size=blackbox_size,
35
                                     attached_file_size=attached_file_size,
36
                                     system_logs_size=system_logs_size)
37
        size = Feedback.objects.get_size()
38
        self.assertEqual(size, (screenshot_size + blackbox_size + attached_file_size + system_logs_size) * 10)
39
40