• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python recipe.seq函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中model_mommy.recipe.seq函数的典型用法代码示例。如果您正苦于以下问题:Python seq函数的具体用法?Python seq怎么用?Python seq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: test_no_filter_shows_all_sizes_of_business

    def test_no_filter_shows_all_sizes_of_business(self):
        get_contract_recipe().make(_quantity=5, vendor_name=seq("Large Biz"), business_size='o')
        get_contract_recipe().make(_quantity=5, vendor_name=seq("Small Biz"), business_size='s')
        driver = self.load_and_wait()

        self.assert_results_count(driver, 10)

        self.assertIsNotNone(re.search(r'Small Biz\d+', driver.page_source))
        self.assertIsNotNone(re.search(r'Large Biz\d+', driver.page_source))
开发者ID:openbrian,项目名称:calc,代码行数:9,代码来源:tests.py


示例2: setUp

    def setUp(self):
        self.dataset = mommy.make(Dataset)
        self.zero_dataset = mommy.make(Dataset)
        records = mommy.make(DatasetRecord, _quantity=10, value=seq(0))
        zero_records = mommy.make(DatasetRecord, _quantity=10, value=seq(-1))

        for record in records:
            self.dataset.records.add(record)

        for record in zero_records:
            self.zero_dataset.records.add(record)
开发者ID:damonkelley,项目名称:texas-choropleth,代码行数:11,代码来源:tests.py


示例3: get_contract_recipe

def get_contract_recipe():
    return Recipe(
            Contract,
            idv_piid=seq('ABC123'),
            piid=piid,
            vendor_name=seq("CompanyName"),
            labor_category="Business Analyst II",
            schedule=cycle(SCHEDULES),
            min_years_experience=seq(5),
            hourly_rate_year1=seq('2'),
            current_price=seq('2'),
    )
开发者ID:DRTforGSA18F,项目名称:calc,代码行数:12,代码来源:mommy_recipes.py


示例4: xtest_filter_to_only_small_businesses

    def xtest_filter_to_only_small_businesses(self):
        get_contract_recipe().make(_quantity=5, vendor_name=seq("Large Biz"), business_size="o")
        get_contract_recipe().make(_quantity=5, vendor_name=seq("Small Biz"), business_size="s")
        driver = self.load_and_wait()
        form = self.get_form()

        self.set_form_value(form, "business_size", "s")
        self.submit_form_and_wait()

        self.assert_results_count(driver, 5)

        self.assertIsNone(re.search(r"Large Biz\d+", driver.page_source))
        self.assertIsNotNone(re.search(r"Small Biz\d+", driver.page_source))
开发者ID:DavidEBest,项目名称:calc,代码行数:13,代码来源:tests.py


示例5: test_filter_experience_range

    def test_filter_experience_range(self):
        get_contract_recipe().make(_quantity=5, vendor_name=seq("4 years of experience"), min_years_experience=4)
        get_contract_recipe().make(_quantity=5, vendor_name=seq("5 years of experience"), min_years_experience=5)
        driver = self.load_and_wait()
        form = self.get_form()

        self.set_form_value(form, 'experience_range', '5,10')
        self.submit_form_and_wait()

        self.assert_results_count(driver, 5)

        self.assertIsNone(re.search(r'4 years of experience\d+', driver.page_source))
        self.assertIsNotNone(re.search(r'5 years of experience\d+', driver.page_source))
开发者ID:openbrian,项目名称:calc,代码行数:13,代码来源:tests.py


示例6: test_pesquisa_data_adesao_sistema_de_cultura

def test_pesquisa_data_adesao_sistema_de_cultura(client):
    mommy.make('SistemaCultura', _quantity=5, ente_federado__cod_ibge=seq(110),
               data_publicacao_acordo=seq(datetime.date(2018, 12, 21),
               datetime.timedelta(days=1)), _fill_optional=True)
    sistema_de_cultura = SistemaCultura.sistema.first()

    data_param = '?data_adesao={}'.format(sistema_de_cultura.data_publicacao_acordo)
    url = url_sistemadeculturalocal + data_param

    request = client.get(url, content_type="application/hal+json")

    assert len(request.data["_embedded"]["items"]) == 1
    assert request.data["_embedded"]["items"][0]["data_adesao"] == str(sistema_de_cultura.data_publicacao_acordo)
开发者ID:culturagovbr,项目名称:sistema-nacional-cultura,代码行数:13,代码来源:test_api.py


示例7: test_filter_to_only_large_businesses

    def test_filter_to_only_large_businesses(self):
        get_contract_recipe().make(_quantity=5, vendor_name=seq("Large Biz"), business_size='o')
        get_contract_recipe().make(_quantity=5, vendor_name=seq("Small Biz"), business_size='s')
        driver = self.load_and_wait()
        form = self.get_form()

        self.set_form_value(form, 'business_size', 'o')
        self.submit_form_and_wait()

        self.assert_results_count(driver, 5)

        self.assertIsNone(re.search(r'Small Biz\d+', driver.page_source))
        self.assertIsNotNone(re.search(r'Large Biz\d+', driver.page_source))
开发者ID:openbrian,项目名称:calc,代码行数:13,代码来源:tests.py


示例8: test_filter_schedules

    def test_filter_schedules(self):
        get_contract_recipe().make(_quantity=5, vendor_name=seq("MOBIS"), schedule='MOBIS')
        get_contract_recipe().make(_quantity=5, vendor_name=seq("AIMS"), schedule='AIMS')
        driver = self.load_and_wait()
        form = self.get_form()

        self.set_form_value(form, 'schedule', 'MOBIS')
        self.submit_form_and_wait()

        self.assert_results_count(driver, 5)

        self.assertIsNone(re.search(r'AIMS\d+', driver.page_source))
        self.assertIsNotNone(re.search(r'MOBIS\d+', driver.page_source))
开发者ID:openbrian,项目名称:calc,代码行数:13,代码来源:tests.py


示例9: test_logarithmic_not_in_get_scale_options

 def test_logarithmic_not_in_get_scale_options(self):
     self.dataset = mommy.make(Dataset)
     records = mommy.make(DatasetRecord, _quantity=10, value=seq(-5))
     for record in records:
         self.dataset.records.add(record)
     scales = self.dataset.get_scale_options()
     self.assertIn(SCALE_CHOICES[0], scales)
     self.assertNotIn(SCALE_CHOICES[1], scales)
开发者ID:damonkelley,项目名称:texas-choropleth,代码行数:8,代码来源:tests.py


示例10: test_titles_are_correct

 def test_titles_are_correct(self):
     get_contract_recipe().make(_quantity=1,
                                labor_category=seq("Architect"))
     driver = self.load_and_wait()
     self.assertTrue(
         driver.title.startswith('CALC'),
         'Title mismatch, {} does not start with CALC'.format(driver.title)
     )
开发者ID:18F,项目名称:calc,代码行数:8,代码来源:test_selenium.py


示例11: test_defining_recipes_str

    def test_defining_recipes_str(self):
        from model_mommy.recipe import seq

        p = Recipe("generic.Person", name=seq("foo"))
        try:
            p.make(_quantity=5)
        except AttributeError as e:
            self.fail("%s" % e)
开发者ID:berinhard,项目名称:model_mommy,代码行数:8,代码来源:test_recipes.py


示例12: test_defining_recipes_str

 def test_defining_recipes_str(self):
     from model_mommy.recipe import seq
     p = Recipe('generic.Person',
         name=seq('foo')
     )
     try:
         p.make(_quantity=5)
     except AttributeError, e:
         self.fail('%s' %e)
开发者ID:kevinlondon,项目名称:model_mommy,代码行数:9,代码来源:test_recipes.py


示例13: xtest_price_lte

    def xtest_price_lte(self):
        # note: the hourly rates here will actually start at 80-- this seems
        # like a bug, but whatever
        get_contract_recipe().make(
            _quantity=10, labor_category=seq("Contractor"), hourly_rate_year1=seq(70, 10), current_price=seq(70, 10)
        )
        driver = self.load()
        form = self.get_form()
        self.search_for("Contractor")

        maximum = 100
        # add results count check
        self.set_form_value(form, "price__lte", maximum)
        self.submit_form_and_wait()
        self.assertTrue(
            ("price__lte=%d" % maximum) in driver.current_url, 'Missing "price__lte=%d" in query string' % maximum
        )
        self.assert_results_count(driver, 3)
开发者ID:DavidEBest,项目名称:calc,代码行数:18,代码来源:tests.py


示例14: test_there_is_no_business_size_column

    def test_there_is_no_business_size_column(self):
        get_contract_recipe().make(_quantity=5, vendor_name=seq("Large Biz"), business_size='o')
        driver = self.load()
        form = self.get_form()

        col_headers = get_column_headers(driver)

        for head in col_headers:
            self.assertFalse(has_matching_class(head, 'column-business[_-]size'))
开发者ID:openbrian,项目名称:calc,代码行数:9,代码来源:tests.py


示例15: xtest_form_submit_loading

 def xtest_form_submit_loading(self):
     get_contract_recipe().make(_quantity=1, labor_category=seq("Architect"))
     self.load()
     self.search_for('Architect')
     form = self.submit_form()
     # print(self.driver.execute_script('document.querySelector("#search").className'))
     self.assertTrue(has_class(form, 'loading'), "Form doesn't have 'loading' class")
     self.wait_for(self.data_is_loaded)
     self.assertTrue(has_class(form, 'loaded'), "Form doesn't have 'loaded' class")
     self.assertFalse(has_class(form, 'loading'), "Form shouldn't have 'loading' class after loading")
开发者ID:openbrian,项目名称:calc,代码行数:10,代码来源:tests.py


示例16: test_URL_sistema_cultura_local_retorna_10_sistemas

def test_URL_sistema_cultura_local_retorna_10_sistemas(client):

    for ente in mommy.make('EnteFederado', _quantity=12, cod_ibge=seq(110)):
        mommy.make('SistemaCultura', ente_federado=ente)

    request = client.get(url_sistemadeculturalocal,
                         content_type="application/hal+json")

    assert isinstance(request.data["_embedded"]["items"], list)
    assert len(request.data["_embedded"]["items"]) == 10
开发者ID:culturagovbr,项目名称:sistema-nacional-cultura,代码行数:10,代码来源:test_api.py


示例17: xtest_filter_order_is_correct

    def xtest_filter_order_is_correct(self):
        get_contract_recipe().make(_quantity=1, labor_category=seq("Architect"))
        driver = self.load()
        form = self.get_form()

        inputs = form.find_elements_by_css_selector("input:not([type='hidden'])")

        # the last visible form inputs should be the price filters
        self.assertEqual(inputs[-2].get_attribute('name'), 'price__gte')
        self.assertEqual(inputs[-1].get_attribute('name'), 'price__lte')
开发者ID:openbrian,项目名称:calc,代码行数:10,代码来源:tests.py


示例18: test_retorno_maximo_de_100_objetos_sistema_de_cultura

def test_retorno_maximo_de_100_objetos_sistema_de_cultura(client):

    mommy.make('SistemaCultura', ente_federado__cod_ibge=seq(110), _quantity=110)
    limit_param = '?limit=150'

    url = url_sistemadeculturalocal + limit_param

    request = client.get(url, content_type="application/hal+json")

    assert len(request.data["_embedded"]["items"]) == 100
开发者ID:culturagovbr,项目名称:sistema-nacional-cultura,代码行数:10,代码来源:test_api.py


示例19: test__get_non_zero_max_record

 def test__get_non_zero_max_record(self):
     self.dataset = mommy.make(Dataset)
     value_seq = seq(1, increment_by=-1)
     records = mommy.make(DatasetRecord, _quantity=10, value=value_seq)
     for record in records:
         self.dataset.records.add(record)
     max_record = self.dataset._get_max_record()
     non_zero_max_record = self.dataset._get_non_zero_max_record()
     self.assertEqual(int(max_record), 0)
     self.assertEqual(int(non_zero_max_record), -1)
开发者ID:damonkelley,项目名称:texas-choropleth,代码行数:10,代码来源:tests.py


示例20: test_pesquisa_por_cnpj_prefeitura_em_sistema_de_cultura

def test_pesquisa_por_cnpj_prefeitura_em_sistema_de_cultura(client):

    sistema_cultura = mommy.make('SistemaCultura', ente_federado__cod_ibge=seq(111), _quantity=2, _fill_optional=True)
    cnpj_param = '?cnpj_prefeitura={}'.format(sistema_cultura[0].sede.cnpj)

    url = url_sistemadeculturalocal + cnpj_param

    request = client.get(url, content_type="application/hal+json")

    assert len(request.data["_embedded"]["items"]) == 1
    assert request.data["_embedded"]["items"][0]["_embedded"]["sede"]["localizacao"]["cnpj"] == sistema_cultura[0].sede.cnpj
开发者ID:culturagovbr,项目名称:sistema-nacional-cultura,代码行数:11,代码来源:test_api.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python recipe.Recipe类代码示例发布时间:2022-05-27
下一篇:
Python recipe.foreign_key函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap