Skip to content

Commit 3677832

Browse files
committed
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
1 parent ede2dba commit 3677832

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/test_cgi.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import unittest, os, shutil, errno, sys, difflib, cgi, re, io
1313

1414
import pytest
15+
import copy
1516

1617
from roundup.cgi import client, actions, exceptions
1718
from roundup.cgi.exceptions import FormError, NotFound, Redirect
@@ -1084,7 +1085,6 @@ def hasPermission(s, p, classname=None, d=None, e=None, **kw):
10841085
del(out[0])
10851086
cl.db.config['WEB_CSRF_ENFORCE_TOKEN'] = 'yes'
10861087

1087-
import copy
10881088
form2 = copy.copy(form)
10891089
form2.update({'@csrf': 'booogus'})
10901090
# add a bogus csrf field to the form and rerun the inner_main
@@ -1763,6 +1763,8 @@ def testRegisterActionUnusedUserCheck(self):
17631763
def testserve_static_files(self):
17641764
# make a client instance
17651765
cl = self._make_client({})
1766+
# Make local copy in cl to not modify value in class
1767+
cl.Cache_Control = copy.copy (cl.Cache_Control)
17661768

17671769
# hijack _serve_file so I can see what is found
17681770
output = []

test/test_liveserver.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,6 @@ def test_compression_zstd(self):
10011001
f.headers.items() if key in expected },
10021002
expected)
10031003

1004-
@pytest.mark.xfail(reason="Fails with 3600 age on circle ci not sure why")
10051004
def test_cache_control_css(self):
10061005
f = requests.get(self.url_base() + '/@@file/style.css',
10071006
headers = {'content-type': "",

0 commit comments

Comments
 (0)