@pytest.mark.django_db
def test_approve_addons_get_files_bad_guid():
 addon1 = addon_factory(status=amo.STATUS_NOMINATED, guid='foo')
 addon1_file = addon1.find_latest_version(amo.RELEASE_CHANNEL_LISTED).files.get()
 addon1_file.update(status=amo.STATUS_AWAITING_REVIEW)
 addon2 = addon_factory(status=amo.STATUS_NOMINATED, guid='bar')
 addon2_file = addon2.find_latest_version(amo.RELEASE_CHANNEL_LISTED).files.get()
 addon2_file.update(status=amo.STATUS_AWAITING_REVIEW)
 assert (approve_addons.get_files(['foo']) == [addon1_file])

@ pytest . mark . django_db def test_approve_addons_get_files_bad_guid ( ) : addon1 = addon_factory ( status = amo . STATUS_NOMINATED , guid = 'foo' ) addon1_file = addon1 . find_latest_version ( amo . RELEASE_CHANNEL_LISTED ) . files . get ( ) addon1_file . update ( status = amo . STATUS_AWAITING_REVIEW ) addon2 = addon_factory ( status = amo . STATUS_NOMINATED , guid = 'bar' ) addon2_file = addon2 . find_latest_version ( amo . RELEASE_CHANNEL_LISTED ) . files . get ( ) addon2_file . update ( status = amo . STATUS_AWAITING_REVIEW ) assert ( approve_addons . get_files ( [ 'foo' ] ) == [ addon1_file ] )
an add-on with another guid doesnt get approved .