|  | @@ -27,10 +27,14 @@ def eq_(a, b, msg=None):
 | 
	
		
			
			| 27 | 27 |  
 | 
	
		
			
			| 28 | 28 |  
 | 
	
		
			
			| 29 | 29 |  class FunctionalTest(unittest.TestCase):
 | 
	
		
			
			|  | 30 | +
 | 
	
		
			
			|  | 31 | +    fixtures = [BaseFixture]
 | 
	
		
			
			|  | 32 | +    sqlalchemy_url = 'sqlite:///tracim_test.sqlite'
 | 
	
		
			
			|  | 33 | +
 | 
	
		
			
			| 30 | 34 |      def setUp(self):
 | 
	
		
			
			| 31 | 35 |          DepotManager._clear()
 | 
	
		
			
			| 32 | 36 |          settings = {
 | 
	
		
			
			| 33 |  | -            'sqlalchemy.url': 'sqlite:///tracim_test.sqlite',
 | 
	
		
			
			|  | 37 | +            'sqlalchemy.url': self.sqlalchemy_url,
 | 
	
		
			
			| 34 | 38 |              'user.auth_token.validity': '604800',
 | 
	
		
			
			| 35 | 39 |              'depot_storage_dir': '/tmp/test/depot',
 | 
	
		
			
			| 36 | 40 |              'depot_storage_name': 'test',
 | 
	
	
		
			
			|  | @@ -51,7 +55,7 @@ class FunctionalTest(unittest.TestCase):
 | 
	
		
			
			| 51 | 55 |              dbsession = get_tm_session(session_factory, transaction.manager)
 | 
	
		
			
			| 52 | 56 |              try:
 | 
	
		
			
			| 53 | 57 |                  fixtures_loader = FixturesLoader(dbsession, app_config)
 | 
	
		
			
			| 54 |  | -                fixtures_loader.loads([BaseFixture])
 | 
	
		
			
			|  | 58 | +                fixtures_loader.loads(self.fixtures)
 | 
	
		
			
			| 55 | 59 |                  transaction.commit()
 | 
	
		
			
			| 56 | 60 |                  print("Database initialized.")
 | 
	
		
			
			| 57 | 61 |              except IntegrityError:
 | 
	
	
		
			
			|  | @@ -72,10 +76,22 @@ class FunctionalTest(unittest.TestCase):
 | 
	
		
			
			| 72 | 76 |          DepotManager._clear()
 | 
	
		
			
			| 73 | 77 |  
 | 
	
		
			
			| 74 | 78 |  
 | 
	
		
			
			|  | 79 | +class FunctionalTestEmptyDB(FunctionalTest):
 | 
	
		
			
			|  | 80 | +    fixtures = []
 | 
	
		
			
			|  | 81 | +
 | 
	
		
			
			|  | 82 | +
 | 
	
		
			
			|  | 83 | +class FunctionalTestNoDB(FunctionalTest):
 | 
	
		
			
			|  | 84 | +    sqlalchemy_url = 'sqlite://'
 | 
	
		
			
			|  | 85 | +
 | 
	
		
			
			|  | 86 | +    def init_database(self, settings):
 | 
	
		
			
			|  | 87 | +        self.engine = get_engine(settings)
 | 
	
		
			
			|  | 88 | +
 | 
	
		
			
			|  | 89 | +
 | 
	
		
			
			| 75 | 90 |  class BaseTest(unittest.TestCase):
 | 
	
		
			
			| 76 | 91 |      """
 | 
	
		
			
			| 77 | 92 |      Pyramid default test.
 | 
	
		
			
			| 78 | 93 |      """
 | 
	
		
			
			|  | 94 | +
 | 
	
		
			
			| 79 | 95 |      def setUp(self):
 | 
	
		
			
			| 80 | 96 |          logger.debug(self, 'Setup Test...')
 | 
	
		
			
			| 81 | 97 |          self.config = testing.setUp(settings={
 | 
	
	
		
			
			|  | @@ -97,7 +113,7 @@ class BaseTest(unittest.TestCase):
 | 
	
		
			
			| 97 | 113 |              get_engine,
 | 
	
		
			
			| 98 | 114 |              get_session_factory,
 | 
	
		
			
			| 99 | 115 |              get_tm_session,
 | 
	
		
			
			| 100 |  | -            )
 | 
	
		
			
			|  | 116 | +        )
 | 
	
		
			
			| 101 | 117 |  
 | 
	
		
			
			| 102 | 118 |          self.engine = get_engine(settings)
 | 
	
		
			
			| 103 | 119 |          session_factory = get_session_factory(self.engine)
 |