|
@@ -131,29 +131,47 @@ def test_skip_wizard():
|
|
|
c = make_logged_in_client() # is_superuser
|
|
c = make_logged_in_client() # is_superuser
|
|
|
|
|
|
|
|
response = c.get('/', follow=True)
|
|
response = c.get('/', follow=True)
|
|
|
- assert_true(['admin_wizard.mako' in _template.filename for _template in response.templates], [_template.filename for _template in response.templates])
|
|
|
|
|
|
|
+ assert_true(
|
|
|
|
|
+ ['admin_wizard.mako' in _template.filename for _template in response.templates],
|
|
|
|
|
+ [_template.filename for _template in response.templates]
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
c.cookies['hueLandingPage'] = 'home'
|
|
c.cookies['hueLandingPage'] = 'home'
|
|
|
response = c.get('/', follow=True)
|
|
response = c.get('/', follow=True)
|
|
|
- assert_true(['home.mako' in _template.filename for _template in response.templates], [_template.filename for _template in response.templates])
|
|
|
|
|
|
|
+ assert_true(
|
|
|
|
|
+ ['home.mako' in _template.filename for _template in response.templates],
|
|
|
|
|
+ [_template.filename for _template in response.templates]
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
c.cookies['hueLandingPage'] = ''
|
|
c.cookies['hueLandingPage'] = ''
|
|
|
response = c.get('/', follow=True)
|
|
response = c.get('/', follow=True)
|
|
|
- assert_true(['admin_wizard.mako' in _template.filename for _template in response.templates], [_template.filename for _template in response.templates])
|
|
|
|
|
|
|
+ assert_true(
|
|
|
|
|
+ ['admin_wizard.mako' in _template.filename for _template in response.templates],
|
|
|
|
|
+ [_template.filename for _template in response.templates]
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
|
|
|
|
|
c = make_logged_in_client(username="test_skip_wizard", password="test_skip_wizard", is_superuser=False)
|
|
c = make_logged_in_client(username="test_skip_wizard", password="test_skip_wizard", is_superuser=False)
|
|
|
|
|
|
|
|
response = c.get('/', follow=True)
|
|
response = c.get('/', follow=True)
|
|
|
- assert_true(['home.mako' in _template.filename for _template in response.templates], [_template.filename for _template in response.templates])
|
|
|
|
|
|
|
+ assert_true(
|
|
|
|
|
+ ['home.mako' in _template.filename for _template in response.templates],
|
|
|
|
|
+ [_template.filename for _template in response.templates]
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
c.cookies['hueLandingPage'] = 'home'
|
|
c.cookies['hueLandingPage'] = 'home'
|
|
|
response = c.get('/', follow=True)
|
|
response = c.get('/', follow=True)
|
|
|
- assert_true(['home.mako' in _template.filename for _template in response.templates], [_template.filename for _template in response.templates])
|
|
|
|
|
|
|
+ assert_true(
|
|
|
|
|
+ ['home.mako' in _template.filename for _template in response.templates],
|
|
|
|
|
+ [_template.filename for _template in response.templates]
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
c.cookies['hueLandingPage'] = ''
|
|
c.cookies['hueLandingPage'] = ''
|
|
|
response = c.get('/', follow=True)
|
|
response = c.get('/', follow=True)
|
|
|
- assert_true(['home.mako' in _template.filename for _template in response.templates], [_template.filename for _template in response.templates])
|
|
|
|
|
|
|
+ assert_true(
|
|
|
|
|
+ ['home.mako' in _template.filename for _template in response.templates],
|
|
|
|
|
+ [_template.filename for _template in response.templates]
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
def test_public_views():
|
|
def test_public_views():
|
|
|
c = Client()
|
|
c = Client()
|
|
@@ -240,14 +258,20 @@ def hue_version():
|
|
|
HUE_VERSION_BAK = HUE_VERSION
|
|
HUE_VERSION_BAK = HUE_VERSION
|
|
|
|
|
|
|
|
try:
|
|
try:
|
|
|
- assert_equal('cdh6.x-SNAPSHOT', _version_from_properties(string_io("""# Autogenerated build properties
|
|
|
|
|
-version=3.9.0-cdh5.9.0-SNAPSHOT
|
|
|
|
|
-git.hash=f5fbe90b6a1d0c186b0ddc6e65ce5fc8d24725c8
|
|
|
|
|
-cloudera.cdh.release=cdh6.x-SNAPSHOT
|
|
|
|
|
-cloudera.hash=f5fbe90b6a1d0c186b0ddc6e65ce5fc8d24725c8aaaaa""")))
|
|
|
|
|
|
|
+ assert_equal('cdh6.x-SNAPSHOT', _version_from_properties(string_io(
|
|
|
|
|
+ """# Autogenerated build properties
|
|
|
|
|
+ version=3.9.0-cdh5.9.0-SNAPSHOT
|
|
|
|
|
+ git.hash=f5fbe90b6a1d0c186b0ddc6e65ce5fc8d24725c8
|
|
|
|
|
+ cloudera.cdh.release=cdh6.x-SNAPSHOT
|
|
|
|
|
+ cloudera.hash=f5fbe90b6a1d0c186b0ddc6e65ce5fc8d24725c8aaaaa"""))
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
- assert_false(_version_from_properties(string_io("""# Autogenerated build properties
|
|
|
|
|
-version=3.9.0-cdh5.9.0-SNAPSHOT git.hash=f5fbe90b6a1d0c186b0ddc6e65ce5fc8d24725c8 cloudera.hash=f5fbe90b6a1d0c186b0ddc6e65ce5fc8d24725c8aaaaa""")))
|
|
|
|
|
|
|
+ assert_false(_version_from_properties(string_io(
|
|
|
|
|
+ """# Autogenerated build properties
|
|
|
|
|
+ version=3.9.0-cdh5.9.0-SNAPSHOT
|
|
|
|
|
+ git.hash=f5fbe90b6a1d0c186b0ddc6e65ce5fc8d24725c8
|
|
|
|
|
+ cloudera.hash=f5fbe90b6a1d0c186b0ddc6e65ce5fc8d24725c8aaaaa"""))
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
assert_false(_version_from_properties(string_io('')))
|
|
assert_false(_version_from_properties(string_io('')))
|
|
|
finally:
|
|
finally:
|
|
@@ -885,10 +909,10 @@ class TestStrictRedirection(object):
|
|
|
response = self.client.post('/hue/accounts/login/', data, **kwargs )
|
|
response = self.client.post('/hue/accounts/login/', data, **kwargs )
|
|
|
assert_equal(expected_status_code, response.status_code)
|
|
assert_equal(expected_status_code, response.status_code)
|
|
|
if expected_status_code == 403:
|
|
if expected_status_code == 403:
|
|
|
- error_msg = 'Redirect to ' + redirection_url + ' is not allowed.'
|
|
|
|
|
- if not isinstance(error_msg, bytes):
|
|
|
|
|
- error_msg = error_msg.encode('utf-8')
|
|
|
|
|
- assert_true(error_msg in response.content, response.content)
|
|
|
|
|
|
|
+ error_msg = 'Redirect to ' + redirection_url + ' is not allowed.'
|
|
|
|
|
+ if not isinstance(error_msg, bytes):
|
|
|
|
|
+ error_msg = error_msg.encode('utf-8')
|
|
|
|
|
+ assert_true(error_msg in response.content, response.content)
|
|
|
|
|
|
|
|
|
|
|
|
|
class BaseTestPasswordConfig(object):
|
|
class BaseTestPasswordConfig(object):
|
|
@@ -1467,16 +1491,16 @@ def test_db_migrations_sqlite():
|
|
|
file_name = 'hue_' + version + '.db'
|
|
file_name = 'hue_' + version + '.db'
|
|
|
path = get_desktop_root('./core/src/desktop/test_data/' + file_name)
|
|
path = get_desktop_root('./core/src/desktop/test_data/' + file_name)
|
|
|
DATABASES[name] = {
|
|
DATABASES[name] = {
|
|
|
- 'ENGINE' : 'django.db.backends.sqlite3',
|
|
|
|
|
- 'NAME' : path,
|
|
|
|
|
- 'USER' : '',
|
|
|
|
|
- 'SCHEMA' : 'public',
|
|
|
|
|
- 'PASSWORD' : '',
|
|
|
|
|
- 'HOST' : '',
|
|
|
|
|
- 'PORT' : '',
|
|
|
|
|
- 'OPTIONS' : '',
|
|
|
|
|
- 'ATOMIC_REQUESTS' : True,
|
|
|
|
|
- 'CONN_MAX_AGE' : 0,
|
|
|
|
|
|
|
+ 'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
|
+ 'NAME': path,
|
|
|
|
|
+ 'USER': '',
|
|
|
|
|
+ 'SCHEMA': 'public',
|
|
|
|
|
+ 'PASSWORD': '',
|
|
|
|
|
+ 'HOST': '',
|
|
|
|
|
+ 'PORT': '',
|
|
|
|
|
+ 'OPTIONS': {},
|
|
|
|
|
+ 'ATOMIC_REQUESTS': True,
|
|
|
|
|
+ 'CONN_MAX_AGE': 0,
|
|
|
}
|
|
}
|
|
|
try:
|
|
try:
|
|
|
call_command('migrate', '--fake-initial', '--database=' + name)
|
|
call_command('migrate', '--fake-initial', '--database=' + name)
|