3 ms·
I agree that this example is a little confusing. The author is making assumptions about the behavior of the Django admin site based on either his previous expe
by condiment 15y ago
I agree that this example is a little confusing. The author is making assumptions about the behavior of the Django admin site based on either his previous experience using it, or the Django documentation. In practice it could be extremely difficult to write advance tests for third-party libraries, although I admit I don't have much experience doing this.
Normally I'd expect devs to write tests based on formal specifications of the desired program output (ha! more like a loose mental model). In these cases, all of the eventual behavior of the tested module will be controlled by code that the dev themselves wrote, which makes a much more compelling argument for TDD, but is also more difficult to convey in a made-for-newbies tutorial like this one.