mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-10-29 18:18:57 +03:00
Convert to use CircleCI and run tests against Django 2.1/Python 3.7
This commit is contained in:
@@ -33,7 +33,6 @@ class LocalizedFieldTestCase(TestCase):
|
||||
field = LocalizedField(required=False)
|
||||
assert field.required == []
|
||||
|
||||
|
||||
@staticmethod
|
||||
def test_from_db_value():
|
||||
"""Tests whether the :see:from_db_value function
|
||||
|
||||
@@ -40,7 +40,6 @@ class LocalizedFieldFormTestCase(TestCase):
|
||||
for field in form.fields:
|
||||
assert not field.required
|
||||
|
||||
|
||||
@staticmethod
|
||||
def test_compress():
|
||||
"""Tests whether the :see:compress function
|
||||
|
||||
@@ -4,7 +4,6 @@ from django.conf import settings
|
||||
from django.db import connection
|
||||
from django.utils import translation
|
||||
|
||||
from localized_fields.value import LocalizedIntegerValue
|
||||
from localized_fields.fields import LocalizedIntegerField
|
||||
|
||||
from .fake_model import get_fake_model
|
||||
@@ -149,7 +148,7 @@ class LocalizedIntegerFieldTestCase(TestCase):
|
||||
|
||||
with connection.cursor() as cursor:
|
||||
table_name = self.TestModel._meta.db_table
|
||||
cursor.execute("update %s set score = 'en=>haha'" % table_name);
|
||||
cursor.execute("update %s set score = 'en=>haha'" % table_name)
|
||||
|
||||
obj.refresh_from_db()
|
||||
assert obj.score.get(settings.LANGUAGE_CODE) is None
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
from django.conf import settings
|
||||
from django.test import TestCase
|
||||
from django.utils import translation
|
||||
|
||||
from localized_fields.fields import LocalizedField
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ class LocalizedValueTestCase(TestCase):
|
||||
|
||||
# with no value, we always expect it to return None
|
||||
localized_value = LocalizedValue()
|
||||
assert localized_value.translate() == None
|
||||
assert localized_value.translate() is None
|
||||
assert str(localized_value) == ''
|
||||
|
||||
# with no value for the default language, the default
|
||||
@@ -164,7 +164,7 @@ class LocalizedValueTestCase(TestCase):
|
||||
})
|
||||
|
||||
translation.activate(settings.LANGUAGE_CODE)
|
||||
assert localized_value.translate() == None
|
||||
assert localized_value.translate() is None
|
||||
assert str(localized_value) == ''
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user