participant_dao_test.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:raw-data-repository 作者: all-of-us 项目源码 文件源码
def test_update_withdrawn_status_fails(self):
    p = Participant(withdrawalStatus=WithdrawalStatus.NO_USE)
    time = datetime.datetime(2016, 1, 1)
    with random_ids([1, 2]):
      with FakeClock(time):
        self.dao.insert(p)

    expected_participant = self._participant_with_defaults(
        participantId=1, version=1, biobankId=2, lastModified=time, signUpTime=time,
        withdrawalStatus=WithdrawalStatus.NO_USE)
    self.assertEquals(expected_participant.asdict(), p.asdict())

    p2 = self.dao.get(1)
    self.assertEquals(p.asdict(), p2.asdict())

    p.version = 1
    p.withdrawalStatus = WithdrawalStatus.NOT_WITHDRAWN
    with self.assertRaises(Forbidden):
      self.dao.update(p)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号