From f8e51c087337baed9b32af78ab550d896f70a663 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 11 May 2022 23:21:42 +0200 Subject: [PATCH] fix test --- InvenTree/plugin/models.py | 4 ++-- InvenTree/plugin/test_api.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/InvenTree/plugin/models.py b/InvenTree/plugin/models.py index cacaabb1d8..50e07df0d6 100644 --- a/InvenTree/plugin/models.py +++ b/InvenTree/plugin/models.py @@ -4,7 +4,7 @@ Plugin model definitions # -*- coding: utf-8 -*- from __future__ import unicode_literals -from logging import warning +import warnings from django.utils.translation import gettext_lazy as _ from django.db import models @@ -100,7 +100,7 @@ class PluginConfig(models.Model): if (self.active is False and self.__org_active is True) or \ (self.active is True and self.__org_active is False): if settings.PLUGIN_TESTING: - warning('A reload was triggered') + warnings.warn('A reload was triggered') registry.reload_plugins() return ret diff --git a/InvenTree/plugin/test_api.py b/InvenTree/plugin/test_api.py index c767f0f8c0..8674d933fc 100644 --- a/InvenTree/plugin/test_api.py +++ b/InvenTree/plugin/test_api.py @@ -146,7 +146,7 @@ class PluginDetailAPITest(InvenTreeAPITestCase): self.assertDictContainsSubset({'base':{'key':'base', 'human_name':'base'}}, mixin_dict) # check reload on save - with self.assertWarns('A reload was triggered'): + with self.assertWarns(Warning('A reload was triggered')): plg_inactive = fixtures.filter(active=False).first() plg_inactive.active = True plg_inactive.save()