I have a Django unit test, and I want to put print statements in it for debugging purposes but apparently django is suppressing them. How else can I print the value of a variable? I may be able to hack around with asserts, etc. but wondering how people do this.
How to debug Django unit tests?
Asked Answered
just use the assert* methods:
self.assertEqual("the valule you want to know", 0)
hard to believe django makes something so basic so hard –
Dollhouse
© 2022 - 2024 — McMap. All rights reserved.
pytest
? It modifies theassert
statement and prints the variables in the assertion for you, if a test fails. – Deluna