updated imports in tests

This commit is contained in:
ilvalle
2016-06-02 14:28:21 +02:00
parent 01bab81432
commit a1fd92b7f8
45 changed files with 182 additions and 169 deletions
+8 -8
View File
@@ -10,15 +10,15 @@ import sys
import unittest
import json
from fix_path import fix_sys_path
from .fix_path import fix_sys_path
fix_sys_path(__file__)
from compileapp import run_controller_in, run_view_in
from languages import translator
from gluon.compileapp import run_controller_in, run_view_in
from gluon.languages import translator
from gluon.storage import Storage, List
import gluon.fileutils
from gluon import fileutils
from gluon.dal import DAL, Field, Table
from gluon.http import HTTP
@@ -36,13 +36,13 @@ class TestAppAdmin(unittest.TestCase):
from gluon.globals import Request, Response, Session, current
from gluon.html import A, DIV, FORM, MENU, TABLE, TR, INPUT, URL, XML
from gluon.validators import IS_NOT_EMPTY
from compileapp import LOAD
from gluon.compileapp import LOAD
from gluon.http import HTTP, redirect
from gluon.tools import Auth
from gluon.sql import SQLDB
from gluon.sqlhtml import SQLTABLE, SQLFORM
self.original_check_credentials = gluon.fileutils.check_credentials
gluon.fileutils.check_credentials = fake_check_credentials
self.original_check_credentials = fileutils.check_credentials
fileutils.check_credentials = fake_check_credentials
request = Request(env={})
request.application = 'welcome'
request.controller = 'appadmin'
@@ -73,7 +73,7 @@ class TestAppAdmin(unittest.TestCase):
self.env = locals()
def tearDown(self):
gluon.fileutils.check_credentials = self.original_check_credentials
fileutils.check_credentials = self.original_check_credentials
def run_function(self):
return run_controller_in(self.env['request'].controller, self.env['request'].function, self.env)