本文整理汇总了Python中fixtures.project_factory.ProjectFactory类的典型用法代码示例。如果您正苦于以下问题:Python ProjectFactory类的具体用法?Python ProjectFactory怎么用?Python ProjectFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProjectFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle
def handle(self, *args, **options):
pf = ProjectFactory()
pf.create_base_project()
示例2: test_document_with_page_select_page
def test_document_with_page_select_page(self):
PF.create_base_project()
d = Document.objects.all()[0]
self.selenium.get('%s/%s%i/?page=2' % (self.live_server_url, _('documents_url'), d.pk))
time.sleep(SELENIUM_SLEEP_TIME + 2)
elem = self.selenium.find_element_by_xpath('//input[@id="page_num"]')
self.assertEqual(elem.get_attribute('value'), '2', "Page on document page not selected/displayed correctly!")
示例3: test_comments_of_content_object_feed
def test_comments_of_content_object_feed(self):
PF.create_base_project()
p1 = Participant.objects.all()[0]
c1 = Comment.objects.all()[0]
response = urllib2.urlopen('%s/%s%i/%srss/' % (TEST_SERVER_URL, _('participants_url'), c1.pk, _('comments_url')))
xml = response.read()
self.assertGreaterEqual(xml.count('<item>'), 1, "Comments of content object rss feed not working!")
示例4: test_question_end_point
def test_question_end_point(self):
PF.create_base_project()
q = Question.objects.all()[0]
url = '%s/api/%s/%s%i/?format=json' % (TEST_SERVER_URL, API_VERSION, 'questions/', q.pk)
response = urllib2.urlopen(url)
json = response.read()
self.assertGreaterEqual(json.count('"title":'), 1, "Question api end point not working!")
示例5: test_project_part_end_point
def test_project_part_end_point(self):
PF.create_base_project()
pp = ProjectPart.objects.all()[0]
url = '%s/api/%s/%s%i/?format=json' % (TEST_SERVER_URL, API_VERSION, 'project_parts/', pp.pk)
response = urllib2.urlopen(url)
json = response.read()
self.assertGreaterEqual(json.count('"name":'), 1, "Project part end point not working!")
示例6: test_contact_page
def test_contact_page(self):
PF.create_base_project()
self.selenium.get('%s/%s' % (self.live_server_url, _('contact_url')))
time.sleep(SELENIUM_SLEEP_TIME)
try:
self.selenium.find_element_by_xpath('//h2[contains(text(),"' + _('Contact') + '")]')
except NoSuchElementException:
self.assertTrue(0, "Contact page not displayed correctly!")
示例7: test_events_page
def test_events_page(self):
PF.create_base_project()
self.selenium.get('%s/%s' % (self.live_server_url, _('events_url')))
time.sleep(SELENIUM_SLEEP_TIME)
try:
self.selenium.find_element_by_xpath('//h2[contains(text(),"' + _("Events") + '")]')
except NoSuchElementException:
self.assertTrue(0, "No process page displayed!")
示例8: test_main_page
def test_main_page(self):
PF.create_base_project()
self.selenium.get('%s/' % (self.live_server_url))
time.sleep(SELENIUM_SLEEP_TIME)
try:
self.selenium.find_element_by_xpath('//div[@id="site_intro_text"]')
except NoSuchElementException:
self.assertTrue(0, "No main page displayed!")
示例9: test_search_page
def test_search_page(self):
PF.create_base_project()
q = '1'
self.selenium.get('%s/%s?q=%s' % (self.live_server_url, _('search_url'), q))
time.sleep(SELENIUM_SLEEP_TIME)
try:
self.selenium.find_element_by_xpath('//h2[contains(text(),"' + q + '")]')
except NoSuchElementException:
self.assertTrue(0, "Search page not displayed correctly!")
示例10: test_question_page
def test_question_page(self):
PF.create_base_project()
q = Question.objects.all()[0]
self.selenium.get('%s/%s%i/' % (self.live_server_url, _('questions_url'), q.pk))
time.sleep(SELENIUM_SLEEP_TIME)
try:
self.selenium.find_element_by_xpath('//h3[contains(text(),"' + q.title + '")]')
except NoSuchElementException:
self.assertTrue(0, "Question page not displayed correctly!")
示例11: test_participant_page
def test_participant_page(self):
PF.create_base_project()
p = Participant.objects.all()[0]
self.selenium.get('%s/%s%i/' % (self.live_server_url, _('participants_url'), p.pk))
time.sleep(SELENIUM_SLEEP_TIME)
try:
self.selenium.find_element_by_xpath('//h3[contains(text(),"' + p.name + '")]')
except NoSuchElementException:
self.assertTrue(0, "Participant page not displayed correctly!")
示例12: test_comments_page
def test_comments_page(self):
PF.create_base_project()
self.selenium.get('%s/%s' % (self.live_server_url, _('comments_url')))
time.sleep(SELENIUM_SLEEP_TIME)
try:
x_path = '//div[@class="comment_header"]'
self.selenium.find_element_by_xpath(x_path)
except NoSuchElementException:
self.assertTrue(0, "Comments page not displayed correctly!")
示例13: test_expand_collapse
def test_expand_collapse(self):
PF.create_base_project()
self.selenium.get('%s/%s' % (self.live_server_url, _('participants_url')))
time.sleep(SELENIUM_SLEEP_TIME)
self.selenium.find_element_by_xpath('//button[@id="bg_expand"]').click()
time.sleep(SELENIUM_SLEEP_TIME)
try:
self.selenium.find_element_by_xpath('//div[@id="pt_ec_box_1" and contains(@style,"display: block")]')
except NoSuchElementException:
self.assertTrue(0, "Expand/collapse UI element not working!")
示例14: test_comments_of_content_object_page
def test_comments_of_content_object_page(self):
PF.create_base_project()
p1 = Participant.objects.all()[0]
c1 = Comment.objects.all()[0]
self.selenium.get('%s/%s%i/%s' % (self.live_server_url, _('participants_url'), p1.pk, _('comments_url')))
time.sleep(SELENIUM_SLEEP_TIME)
try:
x_path = '//h3[contains(text(),"' + p1.name + '")]'
self.selenium.find_element_by_xpath(x_path)
except NoSuchElementException:
self.assertTrue(0, "Comments of content object page not displayed correctly!")
示例15: test_display_comment_on_content_object_page
def test_display_comment_on_content_object_page(self):
PF.create_base_project()
p1 = Participant.objects.all()[0]
c1 = Comment.objects.all()[0]
self.selenium.get('%s/%s%i/?comment_id=%i' % (self.live_server_url, _('participants_url'), p1.pk, c1.pk))
time.sleep(SELENIUM_SLEEP_TIME)
try:
x_path = '//div[@class="modal-header"]/h3[contains(text(),"' + _("Comment") + '")]'
self.selenium.find_element_by_xpath(x_path)
except NoSuchElementException:
self.assertTrue(0, "Comment on content object page not displayed correctly!")