Beispiel #1
0
 def setUp(self):
     Recommendation.init_db()
     Recommendation.remove_all()
Beispiel #2
0
 def test_passing_connection(self):
     """ Pass in the Redis connection """
     # Recommendation.init_db(Redis(host='127.0.0.1', port=6379))
     Recommendation.init_db()
     self.assertIsNotNone(Recommendation.redis)
Beispiel #3
0
 def test_vcap_services(self):
     """ Test if VCAP_SERVICES works """
     Recommendation.init_db()
     self.assertIsNotNone(Recommendation.redis)
Beispiel #4
0
def init_db(redis=None):
    """ Initlaize the model """
    Recommendation.init_db(redis)