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


Python Factory.useraccount方法代码示例

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


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

示例1: test_that_a_new_person_in_account_1_does_not_show_in_account_2_org_people_search

# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import useraccount [as 别名]
    def test_that_a_new_person_in_account_1_does_not_show_in_account_2_org_people_search(self):
        sel = self.selenium
        cache.clear()
        self.go_to_the_login_page()
        self.log_in()
        self.assert_login_succeeded()
        self.create_john_smith_and_verify()
        self.create_new_organization()
        sel.click("css=tabbed_box tab_title")
        time.sleep(0.5)
        sel.click("id_search_new_person")
        sel.type("id_search_new_person", "john")
        time.sleep(2)
        assert sel.is_text_present('John Smith')
        

        a2 = self.create_demo_site("test2")
        ua = Factory.useraccount(account=a2)
        self.set_site("test2")
        self.go_to_the_login_page("test2")
        self.log_in(ua=ua)
        self.assert_login_succeeded()        

        self.create_new_organization()
        sel.click("css=tabbed_box tab_title")
        time.sleep(0.5)
        sel.click("id_search_new_person")
        sel.type("id_search_new_person", "john")
        time.sleep(2)
        assert sel.is_text_present('No people found for search "john".')
开发者ID:skoczen,项目名称:mycelium,代码行数:32,代码来源:selenium_tests.py

示例2: test_that_logged_in_site2s_user_cannot_manually_browse_to_site_ones_page

# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import useraccount [as 别名]
    def test_that_logged_in_site2s_user_cannot_manually_browse_to_site_ones_page(self):
        sel = self.selenium
        a2 = self.create_demo_site("test2")
        ua = Factory.useraccount(account=a2)
        self.go_to_the_login_page("test2")
        self.log_in(ua=ua)
        self.assert_login_succeeded()

        self.go_to_the_login_page()
        self.open("/people")
        assert sel.is_element_present("css=.login_btn")
开发者ID:skoczen,项目名称:mycelium,代码行数:13,代码来源:selenium_tests.py

示例3: test_that_site2s_user_cannot_log_into_site_one

# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import useraccount [as 别名]
    def test_that_site2s_user_cannot_log_into_site_one(self):
        
        a2 = self.create_demo_site("test2")
        self.go_to_the_login_page()
        ua = Factory.useraccount(account=a2)
        self.log_in(ua=ua, with_assert=False)
        self.assert_login_failed()

        self.go_to_the_login_page("test2")
        self.log_in(ua=ua)
        self.assert_login_succeeded()
开发者ID:skoczen,项目名称:mycelium,代码行数:13,代码来源:selenium_tests.py

示例4: test_challenge_has_imported_contacts

# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import useraccount [as 别名]
 def test_challenge_has_imported_contacts(self):
     user_account = Factory.useraccount(self.a1)
     DataImport.objects.create(
         account=self.a1,
         importer=user_account,
         start_time=datetime.datetime.now(),
         import_type="people",
         source_filename="test.csv",
         fields=["first_name","last_name","email","phone_number"],
         has_header=False,
     )
     self.a1.check_challenge_progress()
     assert self.a1.challenge_has_imported_contacts == True
开发者ID:skoczen,项目名称:mycelium,代码行数:15,代码来源:unit_tests.py

示例5: test_that_requesting_an_invalid_group_404s

# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import useraccount [as 别名]
    def test_that_requesting_an_invalid_group_404s(self):
        sel = self.selenium
        self.go_to_the_login_page()
        self.log_in()
        self.assert_login_succeeded()
        # make sure to make a new person
        for i in range(0,10):
            Factory.group(account=self.a1)
        self.create_new_group()
        # get pk
        url = sel.get_location()
        url = url[url.find(":%s/" % settings.LIVE_SERVER_PORT)+5:]

        a2 = self.create_demo_site("test2")
        ua = Factory.useraccount(account=a2)
        self.go_to_the_login_page(site="test2")
        self.log_in(ua=ua)
        self.open(url, site="test2")
        time.sleep(10)
        assert sel.is_text_present("not found")
开发者ID:skoczen,项目名称:mycelium,代码行数:22,代码来源:selenium_tests.py

示例6: test_that_requesting_an_invalid_person_404s

# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import useraccount [as 别名]
    def test_that_requesting_an_invalid_person_404s(self):
        sel = self.selenium
        cache.clear()
        self.go_to_the_login_page()
        self.log_in()
        self.assert_login_succeeded()
        # make sure to make a new person
        for i in range(0,20):
            Factory.person(account=self.a1)
        self.create_john_smith_and_verify()
        # get pk
        url = sel.get_location()
        person_url = url[url.find(":%s/" % settings.LIVE_SERVER_PORT)+5:]


        a2 = self.create_demo_site("test2")
        ua = Factory.useraccount(account=a2)
        self.go_to_the_login_page(site="test2")
        self.log_in(ua=ua)
        self.open(person_url, site="test2")
        assert sel.is_text_present("not found")
开发者ID:skoczen,项目名称:mycelium,代码行数:23,代码来源:selenium_tests.py

示例7: test_that_a_new_person_in_account_1_does_not_show_in_account_2

# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import useraccount [as 别名]
    def test_that_a_new_person_in_account_1_does_not_show_in_account_2(self):
        sel = self.selenium
        self.go_to_the_login_page()
        self.log_in()
        self.assert_login_succeeded()
        self.create_john_smith_and_verify()

        a2 = self.create_demo_site("test2")
        ua = Factory.useraccount(account=a2)
        cache.clear()
        self.go_to_the_login_page("test2")
        self.log_in(ua=ua)

        sel.click("link=People")
        sel.wait_for_page_to_load("30000")
        sel.focus("css=#id_search_query")
        sel.type("css=#id_search_query", "joh smith 555")
        sel.key_down("css=#id_search_query","5")
        sel.key_up("css=#id_search_query","5")

        time.sleep(2)
        assert not sel.is_text_present("John Smith")
开发者ID:skoczen,项目名称:mycelium,代码行数:24,代码来源:selenium_tests.py

示例8: test_challenge_has_created_other_accounts

# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import useraccount [as 别名]
 def test_challenge_has_created_other_accounts(self):
     Factory.useraccount(self.a1)
     self.a1.check_challenge_progress()
     assert self.a1.challenge_has_created_other_accounts == True
开发者ID:skoczen,项目名称:mycelium,代码行数:6,代码来源:unit_tests.py


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