test_commands_dbupgrade.py 文件源码

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

项目:maas 作者: maas 项目源码 文件源码
def test_django_run_renames_piston_tables_if_piston_tables_exists(self):
        self.patch(
            dbupgrade_command, "_south_was_performed").return_value = True
        self.patch(dbupgrade_command, "_find_tables").return_value = [
            "piston_consumer",
            "piston_token",
        ]
        mock_rename = self.patch(
            dbupgrade_command, "_rename_piston_to_piston3")
        mock_call = self.patch(dbupgrade_module, "call_command")
        call_command('dbupgrade', django=True)
        self.assertThat(
            mock_rename, MockCalledOnceWith("default", ["consumer", "token"]))
        self.assertThat(
            mock_call, MockCalledOnceWith(
                "migrate", interactive=False, fake_initial=True))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号