Beispiel #1
0
 def setUp(self):
     self.app = app.test_client()
     self.app.testing = True
     self.user = {
         'user_email': '*****@*****.**',
         'user_name': 'Kaynyts000',
         'user_password': '******'
     }
     self.usertwo = {
         'user_email': '*****@*****.**',
         'user_name': 'Kaynuts000',
         'user_password': '******'
     }
     self.business = {
         'business_name': 'MTN',
         'location': 'Kampala',
         'category': 'Telecomm',
         'business_profile': 'Best Telecomm Company'
     }
     self.review = {
         "review_title": "Best Telecomm Company",
         "review_msg": "Telecommunications"
     }
     db.session.remove()
     db.drop_all()
     db.create_all()
Beispiel #2
0
 def setUp(self):
     self.app = app.test_client()
     self.app.testing = True
     db.session.remove()
     db.drop_all()
     db.create_all()
     self.user = {
         'user_email': '*****@*****.**',
         'user_name': 'sonjaYXG',
         'user_password': '******'
     }
     self.user_two = {
         'user_email': '*****@*****.**',
         'user_name': 'Kaynyts000',
         'user_password': '******'
     }
Beispiel #3
0
 def setUp(self):
     self.app = app.test_client()
     self.app.testing = True
     db.session.remove()
     db.drop_all()
     db.create_all()
     self.user = {'user_email' : '*****@*****.**', 'user_name': 'Kaynuts000', 
                 'user_password' : 'qWerty123'}
     self.user_two = {'user_email' : '*****@*****.**', 'user_name': 'Kaynyts000', 
                     'user_password' : '12345678'}
     self.business = {'business_name': 'MTN Kla', 'location' : 'Kampala', 'category' : 'Telecomm', 
                      'business_profile': 'Best Telecomm Company'}
     self.business_edit = {'business_name': 'MTN-Uganda', 'location' : 'Kampala',
                           'category' : 'Telecommunications', 'business_profile': 'Best Telecomm Company'}
     self.business_edit_duplicate = {'business_name': 'MTN Kawempe', 
                                     'location' : 'Kampala', 'category' : 'Telecomm', 
                                     'business_profile': 'Best Telecomm Company'}
     self.business_two = {'business_name': 'MTN Kawempe', 'location' : 'Kampala', 
                          'category' : 'Telecomm', 'business_profile': 'Best Telecomm Company'}
Beispiel #4
0
    def post(self):
        '''
        COMPLETELY resets the database (!!!WARNING!!!)
        '''
        try:
            db.drop_all()
            db.create_all()
            # add default admin user
            db.session.add(
                User(username='******',
                     password='******',
                     is_admin=True,
                     email='*****@*****.**',
                     access_time=int(time())))
            db.session.commit()
        except:
            db.session.rollback()
            raise ServiceUnavailable('Database error')

        return make_response({'status': 'OK'})
Beispiel #5
0
 def tearDown(self):
     db.session.remove()
     db.drop_all()
Beispiel #6
0
 def tearDown(self):
     super(BaseTestCase, self).tearDown()
     db.session.remove()
     db.drop_all()
     db.engine.dispose()