forked from encode/django-rest-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lazy translation of ListField errors (encode#6708)
* Test init for fields w/ lazy translations * Fix lazy translations for ListField
- Loading branch information
Showing
3 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
from rest_framework import compat # noqa | ||
""" | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters