FeedbackFactory   A
last analyzed

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
1
# coding: utf8
2
3
"""
4
This software is licensed under the Apache 2 license, quoted below.
5
6
Copyright 2015 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.core.files.uploadedfile import SimpleUploadedFile
22
23
import factory
24
25
26
class FeedbackFactory(factory.DjangoModelFactory):
27
    class Meta:
28
        model = 'feedback.Feedback'
29
30
    description = factory.Sequence(lambda n: 'Description #%s' % n)
31
    email = factory.Sequence(lambda n: 'user%[email protected]' % n)
32
    page_url = factory.Sequence(lambda n: 'http://url%s.com/' % n)
33
34
    screenshot = SimpleUploadedFile('./screenshot.png', b' ' * 123)
35
    blackbox = SimpleUploadedFile('./blackbox.tar', b' ' * 123)
36
    system_logs = SimpleUploadedFile('./system_logs.zip', b' ' * 123)
37
    attached_file = SimpleUploadedFile('./attach.zip', b' ' * 123)
38
    feedback_data = {
39
        'web_data': {
40
            'url': 'http://url.com/'
41
        },
42
        'common_data': {
43
            'description': 'description',
44
            'user_email': '[email protected]',
45
      }
46
    }
47