@@ -160,16 +160,24 @@ def test_history_sidebar_expired_store_id(self):
160
160
161
161
def test_history_refresh (self ):
162
162
"""Verify refresh history response has request variables."""
163
- data = {"foo" : "bar" }
164
- self .client .get ("/json_view/" , data , content_type = "application/json" )
165
- data = {"store_id" : "foo" }
166
- response = self .client .get (reverse ("djdt:history_refresh" ), data = data )
163
+ self .client .get ("/json_view/" , {"foo" : "bar" }, content_type = "application/json" )
164
+ self .client .get (
165
+ "/json_view/" , {"spam" : "eggs" }, content_type = "application/json"
166
+ )
167
+
168
+ response = self .client .get (
169
+ reverse ("djdt:history_refresh" ), data = {"store_id" : "foo" }
170
+ )
167
171
self .assertEqual (response .status_code , 200 )
168
172
data = response .json ()
169
- self .assertEqual (len (data ["requests" ]), 1 )
173
+ self .assertEqual (len (data ["requests" ]), 2 )
170
174
171
- store_id = list (DebugToolbar ._store )[0 ]
172
- self .assertIn (html .escape (store_id ), data ["requests" ][0 ]["content" ])
175
+ store_ids = list (DebugToolbar ._store )
176
+ self .assertIn (html .escape (store_ids [0 ]), data ["requests" ][0 ]["content" ])
177
+ self .assertIn (html .escape (store_ids [1 ]), data ["requests" ][1 ]["content" ])
173
178
174
179
for val in ["foo" , "bar" ]:
175
180
self .assertIn (val , data ["requests" ][0 ]["content" ])
181
+
182
+ for val in ["spam" , "eggs" ]:
183
+ self .assertIn (val , data ["requests" ][1 ]["content" ])
0 commit comments