@pytest.mark.parametrize('addon_status,file_status,is_unreviewed', [(amo.STATUS_NOMINATED, amo.STATUS_AWAITING_REVIEW, True), (amo.STATUS_NOMINATED, amo.STATUS_NOMINATED, True), (amo.STATUS_NOMINATED, amo.STATUS_PUBLIC, False), (amo.STATUS_NOMINATED, amo.STATUS_DISABLED, False), (amo.STATUS_NOMINATED, amo.STATUS_BETA, False), (amo.STATUS_PUBLIC, amo.STATUS_AWAITING_REVIEW, True), (amo.STATUS_PUBLIC, amo.STATUS_NOMINATED, True), (amo.STATUS_PUBLIC, amo.STATUS_PUBLIC, False), (amo.STATUS_PUBLIC, amo.STATUS_DISABLED, False), (amo.STATUS_PUBLIC, amo.STATUS_BETA, False)])
def test_unreviewed_files(db, addon_status, file_status, is_unreviewed):
 addon = amo.tests.addon_factory(status=addon_status, guid='foo')
 version = addon.current_version
 file_ = version.files.get()
 file_.update(status=file_status)
 addon.update(status=addon_status)
 assert (addon.reload().status == addon_status)
 assert (file_.reload().status == file_status)

@ pytest . mark . parametrize ( 'addon_status,file_status,is_unreviewed' , [ ( amo . STATUS_NOMINATED , amo . STATUS_AWAITING_REVIEW , True ) , ( amo . STATUS_NOMINATED , amo . STATUS_NOMINATED , True ) , ( amo . STATUS_NOMINATED , amo . STATUS_PUBLIC , False ) , ( amo . STATUS_NOMINATED , amo . STATUS_DISABLED , False ) , ( amo . STATUS_NOMINATED , amo . STATUS_BETA , False ) , ( amo . STATUS_PUBLIC , amo . STATUS_AWAITING_REVIEW , True ) , ( amo . STATUS_PUBLIC , amo . STATUS_NOMINATED , True ) , ( amo . STATUS_PUBLIC , amo . STATUS_PUBLIC , False ) , ( amo . STATUS_PUBLIC , amo . STATUS_DISABLED , False ) , ( amo . STATUS_PUBLIC , amo . STATUS_BETA , False ) ] ) def test_unreviewed_files ( db , addon_status , file_status , is_unreviewed ) : addon = amo . tests . addon_factory ( status = addon_status , guid = 'foo' ) version = addon . current_version file_ = version . files . get ( ) file_ . update ( status = file_status ) addon . update ( status = addon_status ) assert ( addon . reload ( ) . status == addon_status ) assert ( file_ . reload ( ) . status == file_status )
files that need to be reviewed are returned by version .