tor: Fix test case for getting status

Mock the app so that it doesn't have to be loaded.

Closes: #1645.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-09-21 13:28:39 -04:00
1 parent 54b0e7c63b
commit 6db1926a62
1 file changed
+4 -1
+4 -1
View File
@@ -18,6 +18,8 @@
Tests for Tor module.
"""
from unittest.mock import patch
import pytest
from django.core.exceptions import ValidationError
@@ -36,8 +38,9 @@ class TestTor:
utils.is_apt_transport_tor_enabled()
@staticmethod
@patch('plinth.modules.tor.app')
@pytest.mark.usefixtures('needs_root', 'load_cfg')
def test_get_status():
def test_get_status(_app):
"""Test that get_status does not raise any unhandled exceptions.
This should work regardless of whether tor is installed, or