

def test_baseview_registration():
    admin = base.Admin()
    view = MockView()
    bp = view.create_blueprint(admin)
    eq_(view.admin, admin)
    ok_((view.blueprint is not None))
    eq_(view.endpoint, 'mockview')
    eq_(view.url, '/admin/mockview')
    eq_(view.name, 'Mock View')
    eq_(bp.name, view.endpoint)
    eq_(bp.url_prefix, view.url)
    eq_(bp.template_folder, 'templates/bootstrap2')
    eq_(view.static_folder, view.static_folder)
    view = MockView(name='Test', endpoint='foobar')
    view.create_blueprint(base.Admin())
    eq_(view.name, 'Test')
    eq_(view.endpoint, 'foobar')
    eq_(view.url, '/admin/foobar')
    view = MockView(url='test')
    view.create_blueprint(base.Admin())
    eq_(view.url, '/admin/test')
    view = MockView(url='/test/test')
    view.create_blueprint(base.Admin())
    eq_(view.url, '/test/test')
    view = MockView(endpoint='test')
    view.create_blueprint(base.Admin(url='/'))
    eq_(view.url, '/test')
    view = MockView(static_url_path='/static/my/test')
    view.create_blueprint(base.Admin())
    eq_(view.blueprint.static_url_path, '/static/my/test')

dataset/ETHPy150Open mrjoes/flask-admin/flask_admin/tests/test_base.py test_baseview_registration/VarMisuse@113/138 `bp`->`view`