Skip to content

Commit

Permalink
[MISC] Update Tests Part #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Geuthur committed Jan 16, 2025
1 parent a704430 commit 4e593b6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ledger/managers/planetary_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ledger.constants.pi import COMMAND_CENTER, EXTRACTOR_CONTROL_UNIT, SPACEPORTS
from ledger.hooks import get_extension_logger

if TYPE_CHECKING:
if TYPE_CHECKING: # pragma: no cover
from ledger.models.planetary import CharacterPlanet, CharacterPlanetDetails

logger = get_extension_logger(__name__)
Expand Down
11 changes: 7 additions & 4 deletions ledger/tests/test_task_helpers/test_char_planetary.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from unittest.mock import MagicMock, call, patch

from django.core.cache import cache
from django.test import TestCase
from django.utils import timezone
from esi.models import Token
Expand Down Expand Up @@ -50,6 +51,8 @@ def setUpClass(cls):

cls.planetarydetails = planetary_data

cache.clear()

@patch(MODULE_PATH + ".get_token")
@patch(MODULE_PATH + ".CharacterPlanet.objects.filter")
@patch(MODULE_PATH + ".CharacterPlanetDetails.objects")
Expand Down Expand Up @@ -302,7 +305,7 @@ def test_update_character_planetarydetails_no_token(self, mock_get_token):
@patch(MODULE_PATH + ".get_token")
@patch(MODULE_PATH + ".esi")
@patch(MODULE_PATH + ".etag_results")
@patch(MODULE_PATH + ".CharacterPlanetDetails.objects.update_or_create")
@patch(MODULE_PATH + ".CharacterPlanetDetails.objects.update_or_create_layout")
def test_update_character_planetarydetails_exist(
self,
mock_update_or_create,
Expand Down Expand Up @@ -339,7 +342,7 @@ def test_update_character_planetarydetails_exist(
@patch(MODULE_PATH + ".get_token")
@patch(MODULE_PATH + ".esi")
@patch(MODULE_PATH + ".etag_results")
@patch(MODULE_PATH + ".CharacterPlanetDetails.objects.update_or_create")
@patch(MODULE_PATH + ".CharacterPlanetDetails.objects.update_or_create_layout")
def test_update_character_planetarydetails_new_details(
self,
mock_update_or_create,
Expand Down Expand Up @@ -395,7 +398,7 @@ def test_update_character_planetarydetails_new_details(
@patch(MODULE_PATH + ".get_token")
@patch(MODULE_PATH + ".esi")
@patch(MODULE_PATH + ".etag_results")
@patch(MODULE_PATH + ".CharacterPlanetDetails.objects.update_or_create")
@patch(MODULE_PATH + ".CharacterPlanetDetails.objects.update_or_create_layout")
@patch(MODULE_PATH + ".logger")
def test_update_character_planetarydetails_expired_no_alert(
self,
Expand Down Expand Up @@ -439,7 +442,7 @@ def test_update_character_planetarydetails_expired_no_alert(
@patch(MODULE_PATH + ".get_token")
@patch(MODULE_PATH + ".esi")
@patch(MODULE_PATH + ".etag_results")
@patch(MODULE_PATH + ".CharacterPlanetDetails.objects.update_or_create")
@patch(MODULE_PATH + ".CharacterPlanetDetails.objects.update_or_create_layout")
@patch(MODULE_PATH + ".logger")
def test_update_character_planetarydetails_alert_reset(
self,
Expand Down
1 change: 0 additions & 1 deletion testauth/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"allianceauth.corputils",
PACKAGE,
"eveuniverse",
"memberaudit", # added for adaption
]
# By default, apps are prevented from having public views for security reasons.
# If you want to allow specific apps to have public views,
Expand Down

0 comments on commit 4e593b6

Please sign in to comment.