I need to create some kind of MockMixin
for my tests. It should include mocks for everything that calls external sources.
For example, each time I save model in admin panel I call some remote URLs. It would be good, to have that mocked and use like that:
class ExampleTestCase(MockedTestCase):
# tests
So each time I save model in admin, for example in functional tests, this mock is applied instead of calling remote URLs.
Is that actually possible? I'm able to do that for 1 particular test, that is not a problem. But it'd be more useful to have some global mock because I use it a lot.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…