mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-27 20:14:01 +03:00
19ca86d8d6
* Test init for fields w/ lazy translations * Fix lazy translations for ListField
17 lines
750 B
Python
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)
|