Atthavit Wannasakwong

41%
Flag icon
If you find yourself looking at complex views, and having to write a lot of tests for them, it’s time to start thinking about whether that logic could be moved elsewhere: possibly to a form, like we’ve done here. Another possible place would be a custom method on the model class. And — once the complexity of the app demands it — out of Django-specific files and into your own classes and functions, that capture your core business logic.
Test-Driven Development with Python: Obey the Testing Goat: Using Django, Selenium, and JavaScript
Rate this book
Clear rating