def _settlement_application(self, match_id):
     # 提交结算申请
     match = Match.get_or_404(id=match_id)
     if not match.can_apply_settlement():
         self.write_error(403, "此活动不能手动结算")
     else:
         MatchService.settlement_application(self.current_user, match)
         self.write_success()
Exemple #2
0
 def test_new_application_approved(self):
     user = mixer.blend(User)
     match = mixer.blend(Match)
     application = mixer.blend(SettlementApplication,
                               match_id=match.id,
                               user_id=user.id)
     with self.assertRaises(SettlementApplicationExist):
         MatchService.settlement_application(user, match)
Exemple #3
0
 def test_new_application(self):
     match = mixer.blend(Match)
     user = mixer.blend(User)
     MatchService.settlement_application(user=user, match=match)