Marijke Luttekes on Nostr: Developers; regarding unit tests. I know it's generally frowned-up to generalize test ...
Developers; regarding unit tests.
I know it's generally frowned-up to generalize test code outside of the current module…
I have some Django admin view availability tests that I want to repeat over multiple apps. They are already parameterized (it's pytest).
Rather than copy/pasting them everywhere, I am considering moving them to an extendable class, so you'll only need to implement them with one or two configuration attributes.
What do we think about this?
#Django #Python
Published at
2025-01-01 22:38:23 UTCEvent JSON
{
"id": "0805b656b5c00827f7ba7642fe1ee956ebbec0c0329dcdbb9414c71dca1585df",
"pubkey": "6f5b6fead460beb6b46fec8bf096ea243c01becbdfc3d663aa7d485e7d8e50c5",
"created_at": 1735771103,
"kind": 1,
"tags": [
[
"proxy",
"https://fosstodon.org/@mahryekuh/113755495037837736",
"web"
],
[
"t",
"django"
],
[
"t",
"python"
],
[
"proxy",
"https://fosstodon.org/users/mahryekuh/statuses/113755495037837736",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://fosstodon.org/users/mahryekuh/statuses/113755495037837736",
"pink.momostr"
],
[
"-"
]
],
"content": "Developers; regarding unit tests.\n\nI know it's generally frowned-up to generalize test code outside of the current module…\n\nI have some Django admin view availability tests that I want to repeat over multiple apps. They are already parameterized (it's pytest).\n\nRather than copy/pasting them everywhere, I am considering moving them to an extendable class, so you'll only need to implement them with one or two configuration attributes.\n\nWhat do we think about this?\n\n#Django #Python",
"sig": "4887e3a78befca8d0ee3933e1726e914c932ac1df4871e40390961f20807217eb0c9d3747aa0d8119d235f28609c6b0b1b88128bf0ace7249396c1eb81bcf9df"
}