hjwp / Book-TDD-Web-Dev-Python

Book - TDD web dev with Python
https://www.obeythetestinggoat.com
Other
484 stars 175 forks source link

Fixes for tests in 13 #257

Closed hjwp closed 3 months ago

hjwp commented 3 months ago

The tests here were failing because a couple of changes we made to the listings were not in sync witht he commit history of the branch in the book-example repo. Here's how I fixed things at a high level:

that procedure, reset --hard <commit N> + commit <new commit N+1> + git cherry-pick <old-commit-N+1...end> is one i use quite often. it's a bit like a rebase, rewriting history.

Then I followed a similar procedure to introduce an extra commit for when we remove the early return as well. I added that to the book chapter text too.

Finally I noticed a problem with applying one of the later commits, it couldn't apply the commit patch successfully. I managed to figure out that was because of the change where we swapped the order of form.save() and form.full_clean(). SO for that I did a git rebase --interactive and marked the commit where we introduce that form.full_clean() for editing, and changed it to match the book.

that gave me a conflict at the end of the rebase, which is expected, and so i fixed that..... i'm aware this explanation is getting a little abstract probably. but i thought it was good to write it down.

happy to go over this sort of procedure in detail with you one of these days! there just never seems to be enough timeeeeeeee. but, you have to invest time to make time! so.