django-rest-framework/tests/importable/__init__.py
Ryan P Kilby 19ca86d8d6
Fix lazy translation of ListField errors (#6708)
* Test init for fields w/ lazy translations
* Fix lazy translations for ListField
2019-05-22 19:41:53 -07:00

17 lines
750 B
Python

"""
This test "app" exists to ensure that parts of Django REST Framework can be
imported/invoked before Django itself has been fully initialized.
"""
from rest_framework import compat, serializers # noqa
# test initializing fields with lazy translations
class ExampleSerializer(serializers.Serializer):
charfield = serializers.CharField(min_length=1, max_length=2)
integerfield = serializers.IntegerField(min_value=1, max_value=2)
floatfield = serializers.FloatField(min_value=1, max_value=2)
decimalfield = serializers.DecimalField(max_digits=10, decimal_places=1, min_value=1, max_value=2)
durationfield = serializers.DurationField(min_value=1, max_value=2)
listfield = serializers.ListField(min_length=1, max_length=2)