@@ -60,6 +60,13 @@ def test_get_active_devices_weekly_installed_by_version(
6060 ):
6161 mock_is_authenticated .return_value = True
6262
63+ with self .client .session_transaction () as sess :
64+ sess ["publisher" ] = {
65+ "nickname" : "test_username" ,
66+ "fullname" : "Test User" ,
67+ "email" : "test@example.com" ,
68+ }
69+
6370 mock_get_item_details .return_value = {"snap_id" : "id" }
6471 random_values = random .sample (range (1 , 30 ), 29 )
6572 dates = [
@@ -125,6 +132,13 @@ def test_get_active_devices_weekly_installed_by_channel(
125132 ]
126133 }
127134
135+ with self .client .session_transaction () as sess :
136+ sess ["publisher" ] = {
137+ "nickname" : "test_username" ,
138+ "fullname" : "Test User" ,
139+ "email" : "test@example.com" ,
140+ }
141+
128142 response = self .client .get (
129143 self .endpoint_url + "?active-devices=channel"
130144 )
@@ -175,6 +189,13 @@ def test_get_active_devices_weekly_installed_by_os(
175189 ]
176190 }
177191
192+ with self .client .session_transaction () as sess :
193+ sess ["publisher" ] = {
194+ "nickname" : "test_username" ,
195+ "fullname" : "Test User" ,
196+ "email" : "test@example.com" ,
197+ }
198+
178199 response = self .client .get (self .endpoint_url + "?active-devices=os" )
179200 self .assertEqual (response .status_code , 200 )
180201 response_json = response .json
@@ -218,6 +239,13 @@ def test_get_active_devices_in_3_months_period(
218239 ]
219240 }
220241
242+ with self .client .session_transaction () as sess :
243+ sess ["publisher" ] = {
244+ "nickname" : "test_username" ,
245+ "fullname" : "Test User" ,
246+ "email" : "test@example.com" ,
247+ }
248+
221249 response = self .client .get (
222250 self .endpoint_url + "?active-devices=architecture&period=3m"
223251 )
@@ -281,6 +309,13 @@ def test_get_active_devices_weekly_installed_by_version(
281309
282310 mock_get_snap_info .return_value = self .snap_payload
283311
312+ with self .client .session_transaction () as sess :
313+ sess ["publisher" ] = {
314+ "nickname" : "test_username" ,
315+ "fullname" : "Test User" ,
316+ "email" : "test@example.com" ,
317+ }
318+
284319 response = self .client .get (self .endpoint_url )
285320 self .assertEqual (response .status_code , 200 )
286321 response_json = response .json
@@ -361,6 +396,13 @@ def test_get_active_devices_weekly_installed_by_version(
361396 ]
362397 }
363398
399+ with self .client .session_transaction () as sess :
400+ sess ["publisher" ] = {
401+ "nickname" : "test_username" ,
402+ "fullname" : "Test User" ,
403+ "email" : "test@example.com" ,
404+ }
405+
364406 response = self .client .get (self .endpoint_url )
365407 self .assertEqual (response .status_code , 200 )
366408 response_json = response .json
0 commit comments