In the preceding tests, we weren't actually entering any data into the widget; we were simply calling the key validation method directly and evaluating its output. This is good unit testing, but it isn't quite satisfying as a test of this code. Since our custom widget is so deeply dependent on Tkinter's validation API, we'd like to test that we've actually implemented this API correctly. After all, that aspect of the code was more challenging than the actual logic in our validation methods.
We can accomplish this by creating some integration tests that simulate actual user actions and then check the results of those actions. To do this cleanly, we'll first need to create some supporting methods. ...