本文整理汇总了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
})
示例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}
)
示例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
})
示例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)
示例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
})
示例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"]'}
示例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 })
示例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
示例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})
示例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})
示例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})
示例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})