def test_deleting_proposal_after_report(self): CommunityRouter.SUPPORT_REQUIREMENT = 1 result = CommunityRouter( "beginbot", "propose", ["!iasip", "The", "Gang", "Steals", "Kappa"] ).route() Proposal.count() == 1 result = CommunityRouter("uzi", "support", ["@beginbot"]).route() assert BreakingNews.count() == 1 assert Proposal.count() == 0
def test_propose(self): assert Proposal.count() == 0 result = CommunityRouter( "beginbot", "propose", ["!iasip", "The", "Gang", "Steals", "Kappa"] ).route() assert "Thank you @beginbot for your proposal" in result last = Proposal.last() assert last["proposal"] == "The Gang Steals Kappa" assert last["command"] == "iasip"
def test_support(self): CommunityRouter.SUPPORT_REQUIREMENT = 1 BreakingNews.count() == 0 assert Proposal.count() == 0 result = CommunityRouter( "beginbot", "propose", ["!iasip", "The", "Gang", "Steals", "Kappa"] ).route() result = CommunityRouter("uzi", "support", ["@beginbot"]).route() assert result == "@beginbot Thanks You for the support @uzi 1/1" assert BreakingNews.count() == 1
def test_it_is_real(self): assert Proposal.count() == 0 Proposal(user="******", command="iasip", proposal="The Gang Steals Kappa").save() assert Proposal.count() == 1