Skip to content

Commit

Permalink
Some initial decimal field testing in drf
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Apr 3, 2020
1 parent fb6b624 commit 00e65f0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion src/fobi/tests/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,17 @@
'}'
)
),
# (
# 'sample_decimal',
# (
# DecimalInputPlugin.uid,
# '{'
# '"name": "sample_decimal", '
# '"required": false, '
# '"label": "Sample decimal"'
# '}'
# )
# ),
(
'bio',
(
Expand Down Expand Up @@ -636,7 +647,7 @@
# ),
])

TEST_DYNAMIC_FORMS_DEFINITION_DATA_DRF = copy.copy(
TEST_DYNAMIC_FORMS_DEFINITION_DATA_DRF = copy.deepcopy(
TEST_DYNAMIC_FORMS_DEFINITION_DATA
)
TEST_DYNAMIC_FORMS_DEFINITION_DATA_DRF.pop('ignore_01')
Expand All @@ -661,6 +672,11 @@
'drivers_license': FAKER.pybool(),
'special_fields': FAKER.pystr(),
'number_of_children': FAKER.pyint(),
# 'sample_decimal': "%.5f" % FAKER.pydecimal(
# left_digits=3,
# right_digits=5,
# positive=True
# ),
'bio': FAKER.text(),
# 'unicode_name': u'Անուն',
}
Expand Down Expand Up @@ -697,6 +713,12 @@
(u'required', False),
(u'read_only', False),
(u'label', u'Number of children')])),
# (u'sample_decimal', OrderedDict([(u'type', u'decimal'),
# (u'required', False),
# (u'read_only', False),
# (u'label', u'Sample decimal'),
# ('max_digits', 10),
# ('decimal_places', 5)])),
(u'bio', OrderedDict([(u'type', u'string'),
(u'required', True),
(u'read_only', False),
Expand Down
2 changes: 1 addition & 1 deletion src/fobi/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
get_registered_form_element_plugins,
get_registered_form_handler_plugins,
get_registered_themes,
get_registered_form_callbacks
get_registered_form_callbacks,
)
from fobi.models import FormEntry, FormWizardEntry
from fobi.forms import FormEntryForm
Expand Down

0 comments on commit 00e65f0

Please sign in to comment.