Ejemplo n.º 1
0
def test_includeme_session_correct_order(config):
    def register():
        f = lambda: None
        config.registry.registerUtility(f, ISessionFactory)
    config.action(('pyramid_crud', 'session_test'), register)
    pyramid_crud.includeme(config)
    config.commit()
Ejemplo n.º 2
0
def test_includeme_session_wrong_order(config):
    def register():
        f = lambda: None
        config.registry.registerUtility(f, ISessionFactory)
    config.action(('pyramid_crud', 'session_test'), register, order=2)
    pyramid_crud.includeme(config)
    with pytest.raises(ConfigurationError):
        config.commit()
Ejemplo n.º 3
0
def test_includeme_session_correct_order(config):
    def register():
        f = lambda: None
        config.registry.registerUtility(f, ISessionFactory)

    config.action(('pyramid_crud', 'session_test'), register)
    pyramid_crud.includeme(config)
    config.commit()
Ejemplo n.º 4
0
def test_includeme_session_wrong_order(config):
    def register():
        f = lambda: None
        config.registry.registerUtility(f, ISessionFactory)

    config.action(('pyramid_crud', 'session_test'), register, order=2)
    pyramid_crud.includeme(config)
    with pytest.raises(ConfigurationError):
        config.commit()
Ejemplo n.º 5
0
def test_includeme_static_view_none(config, pyramid_request):
    pyramid_crud.includeme(config)
    config.commit()
    pyramid_request.static_url('pyramid_crud:static/test.png')
Ejemplo n.º 6
0
def test_includeme_static_view_default(config, pyramid_request):
    pyramid_crud.includeme(config)
    config.commit()
    url = pyramid_request.static_url('pyramid_crud:static/test.png')
    assert url == 'http://example.com/static/crud/test.png'
Ejemplo n.º 7
0
def test_includeme_no_session(config):
    pyramid_crud.includeme(config)
    with pytest.raises(ConfigurationError):
        config.commit()
Ejemplo n.º 8
0
def test_includeme_static_view_none(config, pyramid_request):
    pyramid_crud.includeme(config)
    config.commit()
    pyramid_request.static_url('pyramid_crud:static/test.png')
Ejemplo n.º 9
0
def test_includeme_static_view_default(config, pyramid_request):
    pyramid_crud.includeme(config)
    config.commit()
    url = pyramid_request.static_url('pyramid_crud:static/test.png')
    assert url == 'http://example.com/static/crud/test.png'
Ejemplo n.º 10
0
def test_includeme_no_session(config):
    pyramid_crud.includeme(config)
    with pytest.raises(ConfigurationError):
        config.commit()