コード例 #1
0
 def test_geokret_missing_comment_not_accepted_for_some_move_type(
         self, move_type, expected):
     move = self.blend_move(type=move_type)
     result = MoveCommentPayload().blend()\
         .set_move(move)\
         .set_type(MOVE_COMMENT_TYPE_MISSING)\
         .post(user=self.user_1, code=expected)
     if expected == 422:
         result.assertRaiseJsonApiError('/data/relationships/move/data')
         self.assertEqual(len(move.comments), 0)
         self.assertFalse(move.geokret.missing)
     else:
         self.assertEqual(len(move.comments), 1)
         self.assertTrue(move.geokret.missing)
コード例 #2
0
 def test_geokret_missing_comment_not_accepted_for_some_move_type(
         self, move_type, expected):
     move = self.blend_move(type=move_type)
     move_comment = self.blend_move_comment(move=move,
                                            type=MOVE_COMMENT_TYPE_COMMENT,
                                            author=self.user_1)
     result = MoveCommentPayload()\
         .set_type(MOVE_COMMENT_TYPE_MISSING)\
         .patch(move_comment.id, user=self.user_1, code=expected)
     if expected == 422:
         result.assertRaiseJsonApiError('/data/relationships/move/data')
         self.assertEqual(move_comment.type, MOVE_COMMENT_TYPE_COMMENT)
         self.assertFalse(move.geokret.missing)
     else:
         result.assertHasType(MOVE_COMMENT_TYPE_MISSING)
         self.assertEqual(move_comment.type, MOVE_COMMENT_TYPE_MISSING)
         self.assertTrue(move.geokret.missing)