Example #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()
Example #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()
Example #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()
Example #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()
Example #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')
Example #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'
Example #7
0
def test_includeme_no_session(config):
    pyramid_crud.includeme(config)
    with pytest.raises(ConfigurationError):
        config.commit()
Example #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')
Example #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'
Example #10
0
def test_includeme_no_session(config):
    pyramid_crud.includeme(config)
    with pytest.raises(ConfigurationError):
        config.commit()