|
12 | 12 |
|
13 | 13 | from openwisp_utils.tests import catch_signal |
14 | 14 |
|
15 | | -from ...tests.utils import TransactionTestMixin |
16 | 15 | from .. import settings as app_settings |
17 | 16 | from ..signals import config_modified, config_status_changed |
18 | 17 | from ..tasks import logger as task_logger |
@@ -356,7 +355,10 @@ def test_context_regression(self): |
356 | 355 | template_qs = Template.objects.filter(type='vpn') |
357 | 356 | self.assertEqual(template_qs.count(), 1) |
358 | 357 | t = template_qs.first() |
359 | | - self.assertDictContainsSubset(_original_context, t.get_context()) |
| 358 | + context = t.get_context() |
| 359 | + # check all items from original context exist in template context |
| 360 | + for key, value in _original_context.items(): |
| 361 | + self.assertEqual(context.get(key), value) |
360 | 362 | self.assertEqual(app_settings.CONTEXT, _original_context) |
361 | 363 |
|
362 | 364 | with self.subTest( |
@@ -517,7 +519,6 @@ def test_regression_preventing_from_fixing_invalid_conf(self): |
517 | 519 |
|
518 | 520 |
|
519 | 521 | class TestTemplateTransaction( |
520 | | - TransactionTestMixin, |
521 | 522 | CreateConfigTemplateMixin, |
522 | 523 | TestVpnX509Mixin, |
523 | 524 | TransactionTestCase, |
@@ -554,7 +555,7 @@ def test_config_status_modified_after_change(self): |
554 | 555 | with catch_signal(config_status_changed) as handler: |
555 | 556 | t.config['interfaces'][0]['name'] = 'eth2' |
556 | 557 | t.full_clean() |
557 | | - with self.assertNumQueries(9): |
| 558 | + with self.assertNumQueries(10): |
558 | 559 | t.save() |
559 | 560 | c.refresh_from_db() |
560 | 561 | handler.assert_not_called() |
|
0 commit comments