1
1
mirror of https://github.com/encode/django-rest-framework.git synced 2025-05-09 02:13:43 +03:00
django-rest-framework/tests/importable/test_installed.py
Ryan P Kilby 19ca86d8d6
Fix lazy translation of ListField errors ()
* Test init for fields w/ lazy translations
* Fix lazy translations for ListField
2019-05-22 19:41:53 -07:00

25 lines
695 B
Python

from django.conf import settings
from tests import importable
def test_installed():
# ensure the test app hasn't been removed from the test suite
assert 'tests.importable' in settings.INSTALLED_APPS
def test_compat():
assert hasattr(importable, 'compat')
def test_serializer_fields_initialization():
assert hasattr(importable, 'ExampleSerializer')
serializer = importable.ExampleSerializer()
assert 'charfield' in serializer.fields
assert 'integerfield' in serializer.fields
assert 'floatfield' in serializer.fields
assert 'decimalfield' in serializer.fields
assert 'durationfield' in serializer.fields
assert 'listfield' in serializer.fields