~/talk

Practical Unit Testing in Django

Talkat DjangoCon US 2017 · 2017-08-13..08-18· [testing]
links:none on file
slides:none on file

Focuses on concrete unit testing techniques for Django: build a minimal view instance with test instance from RequestFactory, call individual methods directly, and assert behavior rather than the whole stack. Shows mocking and dummy subclasses to isolate class based views, mixins, forms and inlineformset logic, patching super calls and using autospec to assert super called once. Demonstrates deleting mock attributes, mocking ORM chains like filter all count, and unit testing form clean() and save() paths to get high coverage.

AI-written summary · about

  1. 0:00Introduction to testing
  2. 1:34What is unit testing
  3. 5:08Testing class-based views
  4. 8:21Testing forms and methods
  5. 14:23Testing mixins
  6. 17:00Advanced mocking techniques
  7. 18:58Testing template tags
  8. 19:38Summary of unit testing
  9. 20:41Q&A and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.