Tests: Use NullCache for async tests.

Caching can't work in async tests, so for them it is mocked to a
null cache that is always empty. Synchronous tests are stubbed
with the real Cachex, which is emptied after every test.
This commit is contained in:
lain 2020-12-18 19:49:01 +01:00
commit 95a9bdfc37
13 changed files with 119 additions and 11 deletions

5
test/support/mocks.ex Normal file
View file

@ -0,0 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
Mox.defmock(Pleroma.CachexMock, for: Pleroma.Caching)