Skip to content

Commit a7b9842

Browse files
[test(geo)] Add regression tests for deactivated device WHOIS handling #1325
This commit adds regression tests to ensure that the WHOIS handling for deactivated devices works as expected.
1 parent 77e8413 commit a7b9842

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

openwisp_controller/config/whois/service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def process_ip_data_and_location(self, force_lookup=False):
210210
Trigger WHOIS lookup based on the conditions of `_need_whois_lookup`.
211211
Tasks are triggered on commit to ensure redundant data is not created.
212212
"""
213-
if self.device.is_deactived():
213+
if self.device.is_deactivated():
214214
return
215215
new_ip = self.device.last_ip
216216
initial_ip = self.device._initial_last_ip
@@ -231,7 +231,7 @@ def update_whois_info(self):
231231
when the data is older than
232232
``OPENWISP_CONTROLLER_WHOIS_REFRESH_THRESHOLD_DAYS``.
233233
"""
234-
if self.device.is_deactived():
234+
if self.device.is_deactivated():
235235
return
236236
ip_address = self.device.last_ip
237237
if not self.is_valid_public_ip_address(ip_address):

openwisp_controller/config/whois/tests/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import importlib
33
from datetime import timedelta
44
from io import StringIO
5-
from unittest import mock, mocke
5+
from unittest import mock
66
from uuid import uuid4
77

88
from django.conf import settings

0 commit comments

Comments
 (0)