@@ -321,22 +321,29 @@ def test_metadata_change_triggers_content_review(self):
321
321
assert str (addon .name ) == data ['name' ]
322
322
assert str (addon .summary ) == data ['summary' ]
323
323
324
- # check we logged the changes
325
- alogs = ActivityLog .objects .filter (action = amo .LOG .EDIT_ADDON_PROPERTY .id )
326
- assert alogs .count () == 2
327
- name_log , summ_log = list (
328
- ActivityLog .objects .filter (action = amo .LOG .EDIT_ADDON_PROPERTY .id )
329
- )
330
- assert name_log .arguments == [self .addon , 'name' ]
331
- assert name_log .details == {
332
- 'added' : ['new name' ],
333
- 'removed' : ['Delicious Bookmarks' ],
334
- }
335
- assert summ_log .arguments == [self .addon , 'summary' ]
336
- assert summ_log .details == {
337
- 'added' : ['new summary' ],
338
- 'removed' : ['Delicious Bookmarks is the official' ],
339
- }
324
+ if self .listed :
325
+ # check we logged the changes
326
+ alogs = ActivityLog .objects .filter (action = amo .LOG .EDIT_ADDON_PROPERTY .id )
327
+ assert alogs .count () == 2
328
+ name_log , summ_log = list (
329
+ ActivityLog .objects .filter (action = amo .LOG .EDIT_ADDON_PROPERTY .id )
330
+ )
331
+ if name_log .arguments [1 ] != 'name' :
332
+ # The order isn't deterministic, it doesn't matter, so just switch em.
333
+ name_log , summ_log = summ_log , name_log
334
+ assert name_log .arguments == [self .addon , 'name' ]
335
+ assert name_log .details == {
336
+ 'added' : ['new name' ],
337
+ 'removed' : ['Delicious Bookmarks' ],
338
+ }
339
+ assert summ_log .arguments == [self .addon , 'summary' ]
340
+ assert summ_log .details == {
341
+ 'added' : ['new summary' ],
342
+ 'removed' : ['Delicious Bookmarks is the official' ],
343
+ }
344
+ else :
345
+ alogs = ActivityLog .objects .filter (action = amo .LOG .EDIT_PROPERTIES .id )
346
+ assert alogs .count () == 1
340
347
341
348
# Now repeat, but we won't be changing either name or summary
342
349
alogs .delete ()
0 commit comments