Weird test behavior in my Django project test suite after an IntegrityError
Posted on 2024-12-01 in Programmation • Tagged with Python, Web, Django
Recently I encountered a very weird behavior in my Django project test suite. I created a view that caught an IntegrityError from the database (caused by duplicates in a unique index). When this error occurs, I want to respond with a 409 - CONFLICT status code and an error message.
TL …
Continue reading