Changeset 4076
- Timestamp:
- 05/05/2008 03:20:03 PM (2 months ago)
- Files:
-
- trunk/dabo/ui/uiwx/test/test_dTextBox.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/ui/uiwx/test/test_dTextBox.py
r3054 r4076 18 18 self.app = None 19 19 20 def mockUserInput(self, str_val ):20 def mockUserInput(self, str_val, lose_focus=True): 21 21 txt = self.txt 22 22 txt._gotFocus() 23 23 txt.SetValue(str_val) 24 txt._lostFocus() 24 if lose_focus: 25 txt._lostFocus() 25 26 26 27 def testStringValue(self): … … 112 113 self.assertTrue(isinstance(txt.Value, decimal.Decimal)) 113 114 115 def testFlushValue(self): 116 txt = self.txt 117 txt.Form.df = None 118 119 txt.DataSource = "form" 120 txt.DataField = "df" 121 txt.Value = "Paul" 122 self.assertEqual(txt.Value, "Paul") 123 self.assertEqual(txt.Value, txt.Form.df) 124 125 self.mockUserInput("kk") 126 self.assertEqual(txt.Value, "kk") 114 127 128 self.mockUserInput("pp", lose_focus=False) 129 self.assertEqual(txt.Value, "pp") 130 self.assertEqual(txt.Form.df, "kk") 131 txt.flushValue() 132 self.assertEqual(txt.Form.df, "pp") 133 self.assertEqual(txt.Value, "pp") 134 135 115 136 if __name__ == "__main__": 116 137 suite = unittest.TestLoader().loadTestsFromTestCase(Test_dTextBox)
