Skip to content Skip to sidebar Skip to footer
Showing posts with the label Python Mock

Mocking Default=timezone.now For Unit Tests

I'm trying to write unit tests for a django app that does a lot of datetime operations. I have… Read more Mocking Default=timezone.now For Unit Tests

How To Mock Just The Method Inside The Class

Trying to write a testcase for my class based function. This is skeleton of my class class Library(… Read more How To Mock Just The Method Inside The Class

How To Mock A Redis Client In Python?

I just found that a bunch of unit tests are failing, due a developer hasn't mocked out the depe… Read more How To Mock A Redis Client In Python?

Mocking File Objects Or Iterables In Python

Which way is proper for mocking and testing code that iters object returned by open(), using mock l… Read more Mocking File Objects Or Iterables In Python

Mocking Default=timezone.now For Unit Tests

I'm trying to write unit tests for a django app that does a lot of datetime operations. I have… Read more Mocking Default=timezone.now For Unit Tests