Learning Django By Making A Tutorial - Part 3 - And a Red-Green Output for unittest

October - 2020

youtube: https://www.youtube.com/watch?v=Al7PxVscCog

[Start: 00:00:00] - Testing Django

I spent most of the stream learning how to do testing inside of Django. Part of that includes jumping over to the Mozilla tutorial which looks worth investigating.

[Time: 2:06:50] - Building a Red Green Color Module for Python's unittest

I'm constantly frustrated by the fact that Python's unittest output is always colored red. Even when all the tests pass. It means you have to look and find the "OK" which requires turning more of your attention to the text. It would be much better if the color of the results was red on failure and green when everything passes (you know, like the whole Red/Green terminology we use).

I build some code a while ago that lets me run test inside a script and only perform the main part of the script if the tests pass. I realized I could use that same code to switch the output of unittest to red/green depending on failure/success. By the end of the session, I got it working. Next step is to figure out how to put it into a module and post it to pip.

Table Of Contents

  • Part 1 - Getting the home page to work
  • Part 2 - Reviewing the first draft and building a model, view, and url structure for a checklist page
  • Part 3 - Learning how to test. And, making a python module so that unittest's output is green instead of red when tests pass.
  • Part 4 - More progress with testing and getting database content to show up. (Also, updating my local Hugo site to launch into either Sublime Text 2, or Sublime Text 3.)
  • Part 5 - Working with forms and getting a pointer to generic views.
  • Part 6 - Review run-through and adding URLs.

Links From The Stream