1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 16:36:06 +00:00

refactor(instances): the VM list calls refresh_instance_database itself

instances.utils.refr() only imported and called computes.utils.refresh_instance_database(); the views import it directly, as they import its siblings from computes.utils.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-08 12:15:33 +03:00
parent e554390ddf
commit 496d3a48ad
15 changed files with 29 additions and 35 deletions

View file

@ -77,7 +77,7 @@ class CreateDialogCpuTestCase(TestCase):
patch.object(Compute, name, new_callable=PropertyMock, return_value=value)
for name, value in (("status", True), ("cpu_count", 1), ("ram_size", 1024), ("ram_usage", 0))
]
patches += [patch("instances.views.utils.refr"), patch("computes.models.wvmHostDetails")]
patches += [patch("instances.views.refresh_instance_database"), patch("computes.models.wvmHostDetails")]
for p in patches:
self.details = p.start() # the last one: the host connection
self.addCleanup(p.stop)
@ -130,7 +130,7 @@ class CreateDialogHostsTestCase(TestCase):
p = patch.object(Compute, name, new_callable=PropertyMock, return_value=value)
p.start()
self.addCleanup(p.stop)
p = patch("instances.views.utils.refr")
p = patch("instances.views.refresh_instance_database")
p.start()
self.addCleanup(p.stop)