@@ -301,22 +301,17 @@ def crashing_callback(fig, stale):
301
301
302
302
303
303
@pytest .mark .backend ('Qt5Agg' , skip_on_importerror = True )
304
- def test_form_widget_get_with_datetime_field ():
304
+ def test_form_widget_get_with_datetime_and_date_fields ():
305
305
if not QtWidgets .QApplication .instance ():
306
306
QtWidgets .QApplication ()
307
- form = [("Field name" , datetime (year = 2021 , month = 3 , day = 11 ))]
308
- widget = _formlayout .FormWidget (form )
309
- widget .setup ()
310
- values = widget .get ()
311
- assert (values == [datetime (year = 2021 , month = 3 , day = 11 )])
312
-
313
-
314
- @pytest .mark .backend ('Qt5Agg' , skip_on_importerror = True )
315
- def test_form_widget_get_with_date_field ():
316
- if not QtWidgets .QApplication .instance ():
317
- QtWidgets .QApplication ()
318
- form = [("Field name" , date (year = 2021 , month = 3 , day = 11 ))]
307
+ form = [
308
+ ("Datetime field" , datetime (year = 2021 , month = 3 , day = 11 )),
309
+ ("Date field" , date (year = 2021 , month = 3 , day = 11 ))
310
+ ]
319
311
widget = _formlayout .FormWidget (form )
320
312
widget .setup ()
321
313
values = widget .get ()
322
- assert (values == [date (year = 2021 , month = 3 , day = 11 )])
314
+ assert values == [
315
+ datetime (year = 2021 , month = 3 , day = 11 ),
316
+ date (year = 2021 , month = 3 , day = 11 )
317
+ ]
0 commit comments