当前位置: 首页>>代码示例>>Python>>正文


Python Survey.delete方法代码示例

本文整理汇总了Python中survey.models.Survey.delete方法的典型用法代码示例。如果您正苦于以下问题:Python Survey.delete方法的具体用法?Python Survey.delete怎么用?Python Survey.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在survey.models.Survey的用法示例。


在下文中一共展示了Survey.delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: SurveyModel

# 需要导入模块: from survey.models import Survey [as 别名]
# 或者: from survey.models.Survey import delete [as 别名]

#.........这里部分代码省略.........
            section=self.section,
            callrequest_id=1,
            response='apple'
        )
        self.result.save()
        self.assertEqual(
            self.result.__unicode__(), '[1] [1] call transfer = apple')

        # ResultAggregate model
        self.result_aggregate = ResultAggregate(
            survey=self.survey,
            section=self.section,
            count=1,
            response='apple'
        )
        self.result_aggregate.save()
        self.assertEqual(
            self.result_aggregate.__unicode__(), '[1] [1] call transfer = apple')

    def test_survey_forms(self):
        self.assertEqual(self.survey_template.name, "test_survey")
        #self.assertEqual(self.section_template.survey, self.survey_template)
        self.assertEqual(self.branching_template.section, self.section_template)
        self.assertEqual(self.result.section, self.section)

        form = PlayMessageSectionForm(self.user, instance=self.section_template)
        obj = form.save(commit=False)
        obj.question = "test question"
        obj.type = 1
        obj.survey = self.survey_template
        obj.save()

        form = MultipleChoiceSectionForm(self.user, instance=self.section_template)
        obj = form.save(commit=False)
        obj.type = 2
        obj.question = "test question"
        obj.key_0 = "apple"
        obj.survey = self.survey_template
        obj.save()

        form = RatingSectionForm(self.user,
                                 instance=self.section_template)
        obj = form.save(commit=False)
        obj.type = 3
        obj.question = "test question"
        obj.rating_laps = 5
        obj.survey_template = self.survey_template
        obj.save()

        form = CaptureDigitsSectionForm(self.user,
                                        instance=self.section_template)
        obj = form.save(commit=False)
        obj.type = 4
        obj.question = "test question"
        obj.number_digits = 2
        obj.min_number = 1
        obj.max_number = 100
        obj.survey = self.survey_template
        obj.save()

        form = RecordMessageSectionForm(self.user)
        obj = form.save(commit=False)
        obj.type = 5
        obj.question = "test question"
        obj.survey = self.survey_template
        obj.save()

        form = CallTransferSectionForm(self.user)
        obj = form.save(commit=False)
        obj.type = 6
        obj.question = "test question"
        obj.phonenumber = 1234567890
        obj.survey = self.survey_template
        obj.save()

        form = SMSSectionForm(self.user)
        obj = form.save(commit=False)
        obj.type = 10
        obj.question = "sms question"
        obj.sms_text = "this is test sms"
        obj.survey = self.survey_template
        obj.save()

        form = ScriptForm()
        obj = form.save(commit=False)
        obj.script = 'xyz'
        obj.survey = self.survey_template
        obj.save()

        form = SurveyDetailReportForm(self.user)

    def teardown(self):
        self.survey_template.delete()
        self.survey.delete()
        self.section_template.delete()
        self.section.delete()
        self.branching_template.delete()
        self.branching.delete()
        self.result.delete()
        self.result_aggregate.delete()
开发者ID:aristide,项目名称:newfies-dialer,代码行数:104,代码来源:tests.py


注:本文中的survey.models.Survey.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。