Woudar's Blog

Simplify your Python tests with dirty equals

Kevin Tewouda's avatar
Kevin Tewouda
Aug 27, 2023
∙ Paid

person hands with black liquids
Photo by Stormseeker on Unsplash

Imagine this scenario, you have created a Todo API and you return this payload when requesting a single todo.

{
    "created_at": "2023-08-27T17:31:14.355813",
    "done": False,
    "id": "70592516-24d5-4582-8d80-54b2c70b5ab1",
    "metadata": {
        "foo": "bar",
        "text": "bla bla"
    },
    "name": "Learn Python",
    "updated_at": None
}

How will you test this payload? Especially the datetime and uuid objects.

Keep reading with a 7-day free trial

Subscribe to Woudar's Blog to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Kevin Tewouda · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture