def test_approving(self): assert SoundeffectRequest.unapproved_count() == 0 subject = SoundeffectRequest( user="******", youtube_id="VW2yff3su0U", command="storm_seeker", start_time="00:01", end_time="00:06", ) subject.save() assert not subject.approved
def test_creating_soundeffect_requests(self, request_parser, expected): assert SoundeffectRequest.count() == 0 subject = SoundeffectRequest( user=request_parser.user, command=request_parser.command, youtube_id=request_parser.youtube_id, start_time=request_parser.start_time, end_time=request_parser.end_time, ) subject.save() assert SoundeffectRequest.count() == 1 assert subject.is_auto_approved() == expected["auto_approved"]
def test_deny_doc_id(self): subject = SoundeffectRequest( user="******", command="damn", youtube_id="VW2yff3su0U", start_time="00:01", end_time="00:05", ) subject.save() request = SoundeffectRequest.get(command="damn") SoundeffectRequest.deny_doc_id("denier", request.doc_id) assert "damn" not in [ request["command"] for request in SoundeffectRequest.all() ]
def test_updating_a_sound(self): assert SoundeffectRequest.count() == 0 subject = SoundeffectRequest( user="******", youtube_id="VW2yff3su0U", command="storm_seeker", start_time="00:01", end_time="00:06", ).save() assert SoundeffectRequest.count() == 1 new_soundeffect = SoundeffectRequest( user="******", youtube_id="VW2yff3su0U", command="storm_seeker", start_time="00:02", end_time="00:08", ) new_soundeffect.save() assert SoundeffectRequest.count() == 1