Test Failed
Pull Request — master (#50)
by
unknown
02:48
created

LocalizedIntegerFieldTestCase   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_from_db_value() 0 11 4
1
from django.test import TestCase
0 ignored issues
show
Configuration introduced by
The import django.test could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
2
from django.conf import settings
0 ignored issues
show
Configuration introduced by
The import django.conf could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
3
from localized_fields.fields import LocalizedField
4
5
from .data import get_init_integer_values
6
7
class LocalizedIntegerFieldTestCase(TestCase):
0 ignored issues
show
Coding Style introduced by
This class has no __init__ method.
Loading history...
8
9
    @staticmethod
10
    def test_from_db_value():
11
        """Tests whether the :see:from_db_value function
12
        produces the expected :see:LocalizedValue."""
13
14
        input_data = get_init_integer_values()
15
        localized_value = LocalizedField().from_db_value(input_data)
16
17
        for lang_code, _ in settings.LANGUAGES:
18
            assert getattr(localized_value, lang_code) == input_data[lang_code]
19
            assert type((getattr(localized_value, lang_code))) == int
20