1👍
Background for test utils
So you are creating a custom Command that you want to execute. Inside your command, you call the function check
(see docs).
Regarding your test case. You are performing 2 test scenarios.
But before you run your tests you provide a patch
. (See docs)
The patch will – if used as decorator – be injected either at constructor or function parameter. For your case patched_check
. Your patched_check
now acts as a mock of your check
function.
What are the test cases doing?
test_wait_for_db_ready(self, patched_check)
validates that self.check
is called with the param databases=['default']
exactly once.
test_wait_for_db_delay
validates that if the self.check
throws an exception then time.sleep(1)
is called 6 times.
0👍
I was facing the same issue, please checkout your database environment variables in docker-compose.yml file. You have misconfigured any of database environment variable.
- [Answered ]-How do I install an older version of a django package?
- [Answered ]-[u"'0' value has an invalid date format. It must be in YYYY-MM-DD format."]
- [Answered ]-How to insert return value from templatetag to {% if
- [Answered ]-Can't update User and UserProfile in one View?