openwisp/openwisp-network-topology

[test] `TestMonitoringIntegration` raises AttributeError

Aryamanz29 opened this issue · 0 comments

  • Due to this change (Make requests to timeseries DB resilient) in openwisp-monitoring, openwisp_network_topology.integrations.device.tests.TestMonitoringIntegration failed.
(env) ➜  tests git:(master) python3 manage.py test openwisp_network_topology.integrations.device.tests.TestMonitoringIntegration.test_monitoring_integration
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
======================================================================
ERROR: test_monitoring_integration (openwisp_network_topology.integrations.device.tests.TestMonitoringIntegration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/mock.py", line 1322, in patched
    with self.decoration_helper(patched,
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/usr/lib/python3.8/unittest/mock.py", line 1304, in decoration_helper
    arg = exit_stack.enter_context(patching)
  File "/usr/lib/python3.8/contextlib.py", line 425, in enter_context
    result = _cm_type.__enter__(cm)
  File "/usr/lib/python3.8/unittest/mock.py", line 1393, in __enter__
    original, local = self.get_original()
  File "/usr/lib/python3.8/unittest/mock.py", line 1366, in get_original
    raise AttributeError(
AttributeError: <class 'openwisp_monitoring.monitoring.apps.MonitoringConfig'> does not have the attribute 'create_database'

----------------------------------------------------------------------
Ran 1 test in 0.134s

FAILED (errors=1)

Solution: We need to update above testcase.