forked from orbit-oss/flask
Do not set dotted attributes on flask.ext
This commit is contained in:
parent
e8020e2c5c
commit
9df2aefd7f
2 changed files with 7 additions and 1 deletions
|
|
@ -58,7 +58,8 @@ class _ExtensionImporter(object):
|
|||
except ImportError:
|
||||
continue
|
||||
module = modules[fullname] = modules[realname]
|
||||
setattr(modules[__name__], modname, module)
|
||||
if '.' not in modname:
|
||||
setattr(modules[__name__], modname, module)
|
||||
return module
|
||||
raise ImportError(fullname)
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ class ExtImportHookTestCase(FlaskTestCase):
|
|||
import_hooks += 1
|
||||
self.assert_equal(import_hooks, 1)
|
||||
|
||||
def teardown(self):
|
||||
from flask import ext
|
||||
for key in ext.__dict__:
|
||||
self.assert_('.' not in key)
|
||||
|
||||
def test_flaskext_new_simple_import_normal(self):
|
||||
from flask.ext.newext_simple import ext_id
|
||||
self.assert_equal(ext_id, 'newext_simple')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue