コード例 #1
0
ファイル: test_core.py プロジェクト: timotsang/saleor
def test_create_fake_order(db):
    for _ in random_data.create_shipping_methods():
        pass
    for _ in random_data.create_users(3):
        pass
        random_data.create_products_by_schema('/', 10, False)
    how_many = 5
    for _ in random_data.create_orders(how_many):
        pass
    Order.objects.all().count() == 5
コード例 #2
0
ファイル: test_core.py プロジェクト: patrys/saleor
def test_create_fake_order(db):
    for _ in random_data.create_shipping_methods():
        pass
    for _ in random_data.create_users(3):
        pass
        random_data.create_products_by_schema('/', 10, False)
    how_many = 5
    for _ in random_data.create_orders(how_many):
        pass
    assert Order.objects.all().count() == 5
コード例 #3
0
ファイル: test_core.py プロジェクト: sumankumar72/saleor
def test_create_fake_order(db, monkeypatch, image):
    # Tests shouldn't depend on images present in placeholder folder
    monkeypatch.setattr('saleor.core.utils.random_data.get_image',
                        Mock(return_value=image))
    for _ in random_data.create_shipping_zones():
        pass
    for _ in random_data.create_users(3):
        random_data.create_products_by_schema('/', 10)
    how_many = 5
    for _ in random_data.create_orders(how_many):
        pass
    assert Order.objects.all().count() == 5
コード例 #4
0
ファイル: test_core.py プロジェクト: mirumee/saleor
def test_create_fake_order(db, monkeypatch, image, media_root):
    # Tests shouldn't depend on images present in placeholder folder
    monkeypatch.setattr(
        "saleor.core.utils.random_data.get_image", Mock(return_value=image)
    )
    for _ in random_data.create_shipping_zones():
        pass
    for _ in random_data.create_users(3):
        random_data.create_products_by_schema("/", 10)
    how_many = 5
    for _ in random_data.create_orders(how_many):
        pass
    assert Order.objects.all().count() == 5
コード例 #5
0
ファイル: test_core.py プロジェクト: zach-luman/saleor
def test_create_fake_order(db, monkeypatch, product_image):
    # Tests shouldn't depend on images present in placeholder folder
    monkeypatch.setattr(
        'saleor.core.utils.random_data.get_image',
        Mock(return_value=product_image))
    for _ in random_data.create_shipping_methods():
        pass
    for _ in random_data.create_users(3):
        pass
        random_data.create_products_by_schema('/', 10, False)
    how_many = 5
    for _ in random_data.create_orders(how_many):
        pass
    assert Order.objects.all().count() == 5
コード例 #6
0
def test_create_fake_users(db):
    how_many = 5
    for _ in random_data.create_users(how_many):
        pass
    assert User.objects.all().count() == 5
コード例 #7
0
ファイル: test_core.py プロジェクト: mirumee/saleor
def test_create_fake_users(db):
    how_many = 5
    for _ in random_data.create_users(how_many):
        pass
    assert User.objects.all().count() == 5