File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
graphene/contrib/django/tests Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
import pytest
2
2
from django .db import models
3
+ from django .utils .translation import ugettext_lazy as _
3
4
from py .test import raises
4
5
5
6
import graphene
@@ -117,6 +118,21 @@ class Meta:
117
118
assert graphene_type .__enum__ .__members__ ['ENGLISH' ].value == 'en'
118
119
119
120
121
+ def test_field_with_choices_gettext ():
122
+ field = models .CharField (help_text = 'Language' , choices = (
123
+ ('es' , _ ('Spanish' )),
124
+ ('en' , _ ('English' ))
125
+ ))
126
+
127
+ class TranslatedModel (models .Model ):
128
+ language = field
129
+
130
+ class Meta :
131
+ app_label = 'test'
132
+
133
+ convert_django_field_with_choices (field )
134
+
135
+
120
136
def test_should_float_convert_float ():
121
137
assert_conversion (models .FloatField , graphene .Float )
122
138
You can’t perform that action at this time.
0 commit comments