@@ -177,19 +177,6 @@ def test_time_variable_preservation(self):
177177 output = self .get_output (self .widget .Outputs .data )
178178 self .assertEqual (str (table [0 , 4 ]), str (output [0 , 4 ]))
179179
180- # if continuous variable edit is used have_time and have_date is not
181- # copied and the time string format is changed
182- idx = self .widget .domain_view .model ().index (4 )
183- self .widget .domain_view .setCurrentIndex (idx )
184- editor = self .widget .editor_stack .findChild (ContinuousVariableEditor )
185-
186- editor .name_edit .setText ("Date_Posted" )
187- editor .commit ()
188- self .widget .commit ()
189- output = self .get_output (self .widget .Outputs .data )
190- self .assertNotEqual (str (table [0 , 4 ]), str (output [0 , 4 ]))
191-
192- self .widget .reset_selected ()
193180 editor = self .widget .editor_stack .findChild (TimeVariableEditor )
194181 editor .name_edit .setText ("Date" )
195182 editor .commit ()
@@ -254,14 +241,18 @@ def test_time_editor(self):
254241 w = TimeVariableEditor ()
255242 self .assertIs (w .get_data (), None )
256243
257- v = TimeVariable ("T" )
244+ v = TimeVariable ("T" , have_date = 1 )
258245 v .attributes .update ({"A" : 1 , "B" : "b" })
259246 w .set_data (v )
260247
261248 self .assertEqual (w .name_edit .text (), v .name )
262249 self .assertEqual (w .labels_model .get_dict (), v .attributes )
263250 self .assertTrue (w .is_same ())
264251
252+ var = w .get_data ()
253+ self .assertTrue (var .have_date )
254+ self .assertFalse (var .have_time )
255+
265256 w .set_data (None )
266257 self .assertEqual (w .name_edit .text (), "" )
267258 self .assertEqual (w .labels_model .get_dict (), {})
0 commit comments