#34184: Improve tutorial by mentioning User Interaction testing like 
django-webtest
-----------------------------------------+------------------------
               Reporter:  Kees Hink      |          Owner:  nobody
                   Type:  New feature    |         Status:  new
              Component:  Documentation  |        Version:  4.1
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 Maybe the tutorial chapter about testing
 (https://docs.djangoproject.com/en/4.1/intro/tutorial05/) could be
 improved a bit by adding a reference to User Interaction testing, as
 provided for example by https://github.com/django-webtest/django-webtest.

 One example where Django's TestCase is not super well suited is a form
 submit. Yes, it's possible to craft a POST request, but it's not
 guaranteed that a form will actually submit the same data.

 Webtest allows user-like interaction by clicking items in a page, filling
 out a form and submitting it, and following redirects.

 In my opinion it's very valuable for comprehensive testing, and i think
 our tutorial would improve if we mention it.

 One could argue that Selenium (which is referenced on the page under
 "Further testing") could be used to achieve this, but that is more work to
 set up, and slower. (I do think Selenium / Playwright) has its place in
 other scenarios.) If it's about testing a form submit, no JavaScript, then
 webtest is more suitable, and very similar to Django's TestCase.

 If this is a good idea, i'm happy to make a proposal PR.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34184>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070184af051945-6ffd2621-59fd-4219-af15-50fe180fe03b-000000%40eu-central-1.amazonses.com.

Reply via email to