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


Python MainTestCase.setUp方法代码示例

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


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

示例1: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     self._create_user_and_login()
     self._publish_transportation_form()
     s = 'transport_2011-07-25_19-05-49'
     self._make_submission(os.path.join(self.this_directory, 'fixtures',
         'transportation', 'instances', s, s + '.xml'))
     self.submission = self.xform.surveys.reverse()[0]
     self.url = reverse(map_view, kwargs={'username': self.user.username,
         'id_string': self.xform.id_string})
     self.perm_url = reverse(set_perm, kwargs={
         'username': self.user.username, 'id_string': self.xform.id_string})
     self.edit_url = reverse(edit, kwargs={
         'username': self.user.username,
         'id_string': self.xform.id_string
     })
     self.show_url = reverse(show,
                 kwargs={'uuid': self.xform.uuid})
     self.show_normal_url = reverse(show, kwargs={
             'username': self.user.username,
             'id_string': self.xform.id_string
     })
     self.api_url = reverse(api, kwargs={
         'username': self.user.username,
         'id_string': self.xform.id_string
     })
开发者ID:larryweya,项目名称:formhub,代码行数:28,代码来源:test_form_permissions.py

示例2: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     self._create_user_and_login()
     self._publish_transportation_form_and_submit_instance()
     self.public_api_url = reverse(
         public_api, kwargs={"username": self.user.username, "id_string": self.xform.id_string}
     )
开发者ID:GeoODK,项目名称:formhub,代码行数:9,代码来源:test_form_public_api.py

示例3: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     self._create_user_and_login()
     self._publish_transportation_form_and_submit_instance()
     self.url = reverse(show, kwargs={
         'username': self.user.username,
         'id_string': self.xform.id_string
     })
开发者ID:TomCoder,项目名称:formhub,代码行数:10,代码来源:test_form_show.py

示例4: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     self.set_role_url = reverse(set_role)
     self._create_user_and_login()
     self._publish_transportation_form()
     self.form_show_url = reverse(show, kwargs={
         'username': self.user.username,
         'id_string': self.xform.id_string
     })
     UserProfile.objects.get_or_create(user=self.user)
开发者ID:GOMOGI,项目名称:formhub,代码行数:12,代码来源:test_people_roles.py

示例5: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     #Already done by setUp
     #self._create_user_and_login()
     self._publish_transportation_form_and_submit_instance()
     self.perm_url = reverse(set_perm, kwargs={
         'username': self.user.username, 'id_string': self.xform.id_string})
     self.show_url = reverse(show, kwargs={'uuid': self.xform.uuid})
     self.url = reverse(enter_data, kwargs={
         'username': self.user.username,
         'id_string': self.xform.id_string
     })
开发者ID:GOMOGI,项目名称:formhub,代码行数:14,代码来源:test_form_enter_data.py

示例6: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     self._create_user_and_login()
     self._publish_transportation_form_and_submit_instance()
     self.delete_url = reverse(delete_data, kwargs={
         'username': self.user.username,
         'id_string': self.xform.id_string
     })
     self.mongo_args = {
         'username': self.user.username, 'id_string': self.xform.id_string,
         'query': "{}", 'limit': 1,
         'sort': '{"_id":-1}', 'fields': '["_id","_uuid"]'}
开发者ID:muazmohamed,项目名称:formhub,代码行数:14,代码来源:test_form_api_delete.py

示例7: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     self._create_user_and_login()
     self._publish_transportation_form_and_submit_instance()
     self.submission = self.xform.surveys.reverse()[0]
     self.url = reverse(show_submission, kwargs={
         'username': self.user.username,
         'id_string': self.xform.id_string,
         'uuid': self.submission.uuid,
     })
     self.survey_url = reverse(survey_responses, kwargs={
             'instance_id': self.submission.pk })
开发者ID:Ecotrust,项目名称:formhub,代码行数:14,代码来源:test_form_show_submission.py

示例8: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
    def setUp(self):
        MainTestCase.setUp(self)
        self._create_user_and_login()
        self._publish_transportation_form()

        # turn on crowd forms for this form
        self.xform.is_crowd_form = True
        self.xform.save()
        self.edit_url = reverse(edit, kwargs={
            'username': self.xform.user.username,
            'id_string': self.xform.id_string
        })
        self.alice = 'alice'
        self.crowdform_count = 0
开发者ID:KeithDoyle,项目名称:formhub,代码行数:16,代码来源:test_crowdforms.py

示例9: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     self._create_user_and_login()
     self._publish_transportation_form()
     s = "transport_2011-07-25_19-05-49"
     self._make_submission(
         os.path.join(self.this_directory, "fixtures", "transportation", "instances", s, s + ".xml")
     )
     self.submission = self.xform.surveys.reverse()[0]
     self.url = reverse(map_view, kwargs={"username": self.user.username, "id_string": self.xform.id_string})
     self.perm_url = reverse(set_perm, kwargs={"username": self.user.username, "id_string": self.xform.id_string})
     self.edit_url = reverse(edit, kwargs={"username": self.user.username, "id_string": self.xform.id_string})
     self.show_url = reverse(show, kwargs={"uuid": self.xform.uuid})
     self.show_normal_url = reverse(show, kwargs={"username": self.user.username, "id_string": self.xform.id_string})
     self.api_url = reverse(api, kwargs={"username": self.user.username, "id_string": self.xform.id_string})
开发者ID:GeoODK,项目名称:formhub,代码行数:17,代码来源:test_form_permissions.py

示例10: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     self._create_user_and_login('bob', 'bob')
     self._publish_transportation_form()
     self.url = reverse(formList, kwargs={'username': self.user.username})
开发者ID:KeithDoyle,项目名称:formhub,代码行数:7,代码来源:test_form_auth.py

示例11: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     self.settings_url = reverse(
         profile_settings, kwargs={'username': self.user.username})
开发者ID:ACTillage,项目名称:formhub,代码行数:6,代码来源:test_user_settings.py

示例12: setUp

# 需要导入模块: from test_base import MainTestCase [as 别名]
# 或者: from test_base.MainTestCase import setUp [as 别名]
 def setUp(self):
     MainTestCase.setUp(self)
     self._create_user_and_login()
     self._publish_transportation_form()
     self.url = reverse(clone_xlsform, kwargs={"username": self.user.username})
开发者ID:GeoODK,项目名称:formhub,代码行数:7,代码来源:test_form_gallery.py


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