diff test/test_cgi.py @ 6651:da6c9050a79e

Fix modification of Cache_Control The previous code modified the Cache_Control dictionary in the Client class (in one of the cgi tests) which made a later test in test_liveserver fail
author Ralf Schlatterbeck <rsc@runtux.com>
date Mon, 02 May 2022 14:25:15 +0200
parents 154f286061e2
children ab2ed11c021e
line wrap: on
line diff
--- a/test/test_cgi.py	Mon May 02 13:46:58 2022 +0200
+++ b/test/test_cgi.py	Mon May 02 14:25:15 2022 +0200
@@ -12,6 +12,7 @@
 import unittest, os, shutil, errno, sys, difflib, cgi, re, io
 
 import pytest
+import copy
 
 from roundup.cgi import client, actions, exceptions
 from roundup.cgi.exceptions import FormError, NotFound, Redirect
@@ -1084,7 +1085,6 @@
         del(out[0])
         cl.db.config['WEB_CSRF_ENFORCE_TOKEN'] = 'yes'
 
-        import copy
         form2 = copy.copy(form)
         form2.update({'@csrf': 'booogus'})
         # add a bogus csrf field to the form and rerun the inner_main
@@ -1763,6 +1763,8 @@
     def testserve_static_files(self):
         # make a client instance
         cl = self._make_client({})
+        # Make local copy in cl to not modify value in class
+        cl.Cache_Control = copy.copy (cl.Cache_Control)
 
         # hijack _serve_file so I can see what is found
         output = []

Roundup Issue Tracker: http://roundup-tracker.org/