Fixes in tests and add check_login function to admin cntroller
This commit is contained in:
parent
b41461cc2c
commit
da9a37a406
10 changed files with 33 additions and 9 deletions
|
|
@ -22,6 +22,8 @@ def start():
|
|||
|
||||
parser.add_argument('--symlink', help='Set if create direct symlink to paramecio in new site', required=False, nargs='?', const='1')
|
||||
|
||||
parser.add_argument('--tests', help='Create a symlink to tests for check into paramecio site', required=False, nargs='?', const='1')
|
||||
|
||||
# Options for deploy
|
||||
|
||||
parser.add_argument('--domain', help='The base domain for this site', required=True)
|
||||
|
|
@ -125,6 +127,13 @@ def start():
|
|||
|
||||
except:
|
||||
print('Error: cannot symlink paramecio in new site')
|
||||
|
||||
if args.tests!=None:
|
||||
try:
|
||||
os.symlink(workdir, args.path+'/paramecio/', True)
|
||||
|
||||
except:
|
||||
print('Error: cannot symlink paramecio in new site')
|
||||
|
||||
with open(path_settings+'/config.py', 'r') as f:
|
||||
conf=f.read()
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from bottle import get,post,response,request
|
|||
from settings import config
|
||||
from settings import config_admin
|
||||
from paramecio.citoplasma.lists import SimpleList
|
||||
from paramecio.citoplasma.adminutils import get_menu, get_language, make_admin_url
|
||||
from paramecio.citoplasma.adminutils import get_menu, get_language, make_admin_url, check_login
|
||||
from paramecio.citoplasma.generate_admin_class import GenerateAdminClass
|
||||
from paramecio.citoplasma.httputils import GetPostFiles
|
||||
from paramecio.cromosoma.formsutils import show_form, pass_values_to_form, set_extra_forms_user
|
||||
|
|
@ -72,7 +72,7 @@ def home(module='', submodule=''):
|
|||
|
||||
s=get_session()
|
||||
|
||||
if 'login' in s:
|
||||
if check_login():
|
||||
|
||||
s['id']=s.get('id', 0)
|
||||
|
||||
|
|
|
|||
|
|
@ -28,4 +28,5 @@ class TestFieldMethods(unittest.TestCase):
|
|||
|
||||
self.assertEqual(json_encoded, '["trick", "mytuquito", "25"]')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -66,4 +66,7 @@ class TestFieldMethods(unittest.TestCase):
|
|||
self.assertEqual(value, '00:24:21')
|
||||
|
||||
print(datetime.local_to_utc('20121221232421', tz))
|
||||
"""
|
||||
"""
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -54,6 +54,5 @@ class TestFieldMethods(unittest.TestCase):
|
|||
|
||||
self.assertEqual(value_two, value_real)
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -57,3 +57,5 @@ class TestFieldMethods(unittest.TestCase):
|
|||
self.assertFalse(emailfield.error)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -36,4 +36,6 @@ class TestFieldMethods(unittest.TestCase):
|
|||
|
||||
#self.assertEqual(phrase, 'this---is-a-crap-phrase-o---f-oh-yeah--')
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -63,3 +63,6 @@ class TestImageFieldMethods(unittest.TestCase):
|
|||
self.assertEqual(value, "injection_\\'")"""
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -20,3 +20,6 @@ class TestFieldMethods(unittest.TestCase):
|
|||
self.assertTrue( s.send(config.portal_email, [config.email_test], 'This is a test', 'A message for test a simple email method in <b>html</b> and attachments', content_type='html', attachments=['tests/images/image.jpg']) )
|
||||
|
||||
#s.quit()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -10,4 +10,6 @@ class TestFieldMethods(unittest.TestCase):
|
|||
|
||||
self.assertEqual(phrase, 'this---is-a-crap-phrase-o---f-oh-yeah--')
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue