Skip to content

Commit

Permalink
Use documented assertion method
Browse files Browse the repository at this point in the history
I can't even find documentation for the `called_with` attribute anymore.

The proper one seems to be `Mock.assert_called_with()` or inspecting
`Mock.call_args` directly.

See also:
https://docs.python.org/3.12/library/unittest.mock.html#unittest.mock.Mock.assert_called_with
  • Loading branch information
tbrlpld committed Jan 27, 2024
1 parent 449caf7 commit 31541db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion laces/tests/test_templatetags/test_laces.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def render_parent_template_with_context(self, context: dict):
return self.parent_template.render(Context(context))

def assertRenderHTMLCalledWith(self, context: dict):
self.assertTrue(self.component.render_html.called_with(Context(context)))
self.component.render_html.assert_called_with(Context(context))

def test_render_html_return_in_parent_template(self):
self.assertEqual(self.component.render_html(), "Rendered HTML")
Expand Down

0 comments on commit 31541db

Please sign in to comment.