def test_calculate_calls_calculate_with_unjsonified_worksheet_and_saves_recalced_json(
            self, mock_calculate):
        sheet = Sheet()
        sheet.jsonify_worksheet = Mock()
        sheet.unjsonify_worksheet = Mock()
        sheet.usercode = sentinel.usercode
        sheet.timeout_seconds = sentinel.timeout_seconds
        sheet.create_private_key = Mock()
        sheet.otp = Mock()

        sheet.calculate()

        self.assertCalledOnce(mock_calculate,
                              sheet.unjsonify_worksheet.return_value,
                              sheet.usercode, sheet.timeout_seconds,
                              sheet.create_private_key.return_value)
        self.assertCalledOnce(sheet.jsonify_worksheet,
                              sheet.unjsonify_worksheet.return_value)
    def test_calculate_calls_calculate_with_unjsonified_worksheet_and_saves_recalced_json(
        self, mock_calculate
    ):
        sheet = Sheet()
        sheet.jsonify_worksheet = Mock()
        sheet.unjsonify_worksheet = Mock()
        sheet.usercode = sentinel.usercode
        sheet.timeout_seconds = sentinel.timeout_seconds
        sheet.create_private_key = Mock()
        sheet.otp = Mock()

        sheet.calculate()

        self.assertCalledOnce(
            mock_calculate,
            sheet.unjsonify_worksheet.return_value,
            sheet.usercode,
            sheet.timeout_seconds,
            sheet.create_private_key.return_value
        )
        self.assertCalledOnce(sheet.jsonify_worksheet, sheet.unjsonify_worksheet.return_value)