Package: neutron-vpnaas-dashboard
Version: Fix unit test failures for Django 4.x
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu mantic ubuntu-patch

Dear Maintainer,

In Ubuntu, the attached patch was applied to achieve the following:

  * d/p/fix-test-failures-with-Django-4.x.patch: Fix unit tests
    that are failing with Django 4.2.4.


Thanks for considering the patch.


-- System Information:
Debian Release: bookworm/sid
  APT prefers jammy-updates
  APT policy: (500, 'jammy-updates'), (500, 'jammy-security'), (500, 'jammy'), 
(100, 'jammy-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.2.0-31-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru 
neutron-vpnaas-dashboard-8.0.0/debian/patches/fix-test-failures-with-Django-4.x.patch
 
neutron-vpnaas-dashboard-8.0.0/debian/patches/fix-test-failures-with-Django-4.x.patch
--- 
neutron-vpnaas-dashboard-8.0.0/debian/patches/fix-test-failures-with-Django-4.x.patch
       1969-12-31 18:00:00.000000000 -0600
+++ 
neutron-vpnaas-dashboard-8.0.0/debian/patches/fix-test-failures-with-Django-4.x.patch
       2023-09-12 17:18:27.000000000 -0400
@@ -0,0 +1,72 @@
+From 9c46ffe619fe948363d0d8b1a533ae7214e65c60 Mon Sep 17 00:00:00 2001
+From: Corey Bryant <corey.bry...@canonical.com>
+Date: Tue, 12 Sep 2023 17:13:51 -0400
+Subject: [PATCH] Fix unit test failures for Django 4.x
+
+These tests have started failing with Django 4.2.4 due to
+comparison of objects with strings. This change just compares
+the repr(object) with the existing strings.
+
+Closes-Bug: #2034952
+Change-Id: Ifce3ab76a659931a6753d4fa796ea2164f9accd8
+---
+ .../dashboards/project/vpn/tests.py               | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/neutron_vpnaas_dashboard/dashboards/project/vpn/tests.py 
b/neutron_vpnaas_dashboard/dashboards/project/vpn/tests.py
+index 9ba235e..b169a5a 100644
+--- a/neutron_vpnaas_dashboard/dashboards/project/vpn/tests.py
++++ b/neutron_vpnaas_dashboard/dashboards/project/vpn/tests.py
+@@ -255,7 +255,8 @@ class VPNTests(test.TestCase):
+         self.assertEqual(workflow.name, workflows.AddVPNService.name)
+ 
+         expected_objs = ['<AddVPNServiceStep: addvpnserviceaction>', ]
+-        self.assertQuerysetEqual(workflow.steps, expected_objs)
++        actual_objs = [repr(step) for step in workflow.steps]
++        self.assertQuerysetEqual(actual_objs, expected_objs)
+ 
+         self.mock_network_list_for_tenant.assert_called_once_with(
+             helpers.IsHttpRequest(), self.tenant.id)
+@@ -331,7 +332,8 @@ class VPNTests(test.TestCase):
+         self.assertEqual(workflow.name, workflows.AddEndpointGroup.name)
+ 
+         expected_objs = ['<AddEndpointGroupStep: addendpointgroupaction>', ]
+-        self.assertQuerysetEqual(workflow.steps, expected_objs)
++        actual_objs = [repr(step) for step in workflow.steps]
++        self.assertQuerysetEqual(actual_objs, expected_objs)
+         self.mock_network_list_for_tenant.assert_called_once_with(
+             helpers.IsHttpRequest(), self.tenant.id)
+ 
+@@ -389,7 +391,8 @@ class VPNTests(test.TestCase):
+         self.assertEqual(workflow.name, workflows.AddIKEPolicy.name)
+ 
+         expected_objs = ['<AddIKEPolicyStep: addikepolicyaction>', ]
+-        self.assertQuerysetEqual(workflow.steps, expected_objs)
++        actual_objs = [repr(step) for step in workflow.steps]
++        self.assertQuerysetEqual(actual_objs, expected_objs)
+ 
+     @helpers.create_mocks({api_vpn: ('ikepolicy_create', )})
+     def test_add_ikepolicy_post(self):
+@@ -448,7 +451,8 @@ class VPNTests(test.TestCase):
+         self.assertEqual(workflow.name, workflows.AddIPsecPolicy.name)
+ 
+         expected_objs = ['<AddIPsecPolicyStep: addipsecpolicyaction>', ]
+-        self.assertQuerysetEqual(workflow.steps, expected_objs)
++        actual_objs = [repr(step) for step in workflow.steps]
++        self.assertQuerysetEqual(actual_objs, expected_objs)
+ 
+     @helpers.create_mocks({api_vpn: ('ipsecpolicy_create', )})
+     def test_add_ipsecpolicy_post(self):
+@@ -525,7 +529,8 @@ class VPNTests(test.TestCase):
+                          'addipsecsiteconnectionaction>',
+                          '<AddIPsecSiteConnectionOptionalStep: '
+                          'addipsecsiteconnectionoptionalaction>', ]
+-        self.assertQuerysetEqual(workflow.steps, expected_objs)
++        actual_objs = [repr(step) for step in workflow.steps]
++        self.assertQuerysetEqual(actual_objs, expected_objs)
+ 
+         self.mock_ikepolicy_list.assert_called_once_with(
+             helpers.IsHttpRequest(),
+-- 
+2.34.1
+
diff -Nru neutron-vpnaas-dashboard-8.0.0/debian/patches/series 
neutron-vpnaas-dashboard-8.0.0/debian/patches/series
--- neutron-vpnaas-dashboard-8.0.0/debian/patches/series        2023-06-19 
10:42:42.000000000 -0400
+++ neutron-vpnaas-dashboard-8.0.0/debian/patches/series        2023-09-12 
17:18:33.000000000 -0400
@@ -1 +1,2 @@
 install-missing-files
+fix-test-failures-with-Django-4.x.patch

Reply via email to