Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review of mocking 1 #345

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

seddonym
Copy link
Collaborator

@seddonym seddonym commented Dec 20, 2024

I like the pragmatic approach you take to mocking here (especially consider we both know they are BAD!) In particular I think the messages framework is a great way of making the point.

I think a bit more explanation for the Django bits wouldn't go amiss - and as I say in the comment, perhaps even ditch the whole authentication backend for a lower-level approach that uses the session framework directly.

It might also be worth drawing the distinction between mocking and monkeypatching, and the trade offs involved with each. Maybe also some more strongly worded advice against directly monkeypatching attributes in tests without tidying up afterwards.

@@ -1429,5 +1465,5 @@ Mocks can leave you tightly coupled to the implementation::
As we saw in <<mocks-tightly-coupled-sidebar>>,
mocks can leave you tightly coupled to your implementation.
For that reason, you shouldn't use them unless you have a good reason.

// DAVID: When rendered, this last point says the same phrase three times in a row.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@seddonym seddonym requested a review from hjwp December 20, 2024 17:14
@seddonym seddonym marked this pull request as ready for review December 20, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant