Esempio n. 1
0
 def test_patch_defaults_leaves_other_fields_untouched(self):
     with app.test_request_context():
         schema = TestSchema()
         data = {'field_without_default': 'value_field_without_default'}
         patched_data = patch_defaults(schema, data)
         self.assertEqual(patched_data.get('field_without_default'),
                          'value_field_without_default')
 def test_patch_defaults_adds_defaults(self):
     schema = TestSchema()
     data = {
         'field_without_default': 'value_field_without_default'
     }
     patched_data = patch_defaults(schema, data)
     self.assertEqual(patched_data.get('field_with_default'), False)
 def test_patch_defaults_leaves_other_fields_untouched(self):
     with app.test_request_context():
         schema = TestSchema()
         data = {
             'field_without_default': 'value_field_without_default'
         }
         patched_data = patch_defaults(schema, data)
         self.assertEqual(patched_data.get('field_without_default'), 'value_field_without_default')
 def test_patch_defaults_adds_defaults(self):
     with app.test_request_context():
         schema = TestSchema()
         data = {
             'field_without_default': 'value_field_without_default'
         }
         patched_data = patch_defaults(schema, data)
         self.assertEqual(patched_data.get('field_with_default'), False)