for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from django.conf import settings
django.conf
This can be caused by one of the following:
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
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.
__init__.py
from django.test import TestCase
django.test
from django.utils import translation
django.utils
from localized_fields.fields import LocalizedField
from .fake_model import get_fake_model
class LocalizedQuerySetTestCase(TestCase):
__init__
"""Tests query sets with models containing :see:LocalizedField."""
Model = None
@classmethod
def setUpClass(cls):
"""Creates the test models in the database."""
super(LocalizedQuerySetTestCase, cls).setUpClass()
cls.Model = get_fake_model(
{
'title': LocalizedField(),
}
)
def test_assign_raw_dict(cls):
inst = cls.Model()
inst.title = dict(en='Bread', ro='Paine')
inst.save()
inst = cls.Model.objects.get(pk=inst.pk)
assert inst.title.en == 'Bread'
assert inst.title.ro == 'Paine'
def test_assign_raw_dict_update(cls):
inst = cls.Model.objects.create(
title=dict(en='Bread', ro='Paine'))
cls.Model.objects.update(
title=dict(en='Beer', ro='Bere'))
assert inst.title.en == 'Beer'
assert inst.title.ro == 'Bere'
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.
2. Missing __init__.py files
This error could also result from missing
__init__.pyfiles in your module folders. Make sure that you place one file in each sub-folder.