Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Set mock firestore client globally for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
christippett committed Jun 23, 2019
1 parent 785d2ad commit 4a7a6ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_firestore_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

DEFAULT_CACHE_LOCATION = settings.CACHES["default"]["LOCATION"]

mock_firestore = MockFirestore()


@pytest.fixture(autouse=True)
def db(monkeypatch):
mock_firestore = MockFirestore()
with monkeypatch.context() as m:
m.setattr(firestore, "Client", lambda: mock_firestore)
yield mock_firestore
Expand Down

0 comments on commit 4a7a6ab

Please sign in to comment.