def setUp(self): self.app = app.test_client() logging.disable(logging.CRITICAL) # connecting to database db.connect() # creating a database db.create_tables([User], safe=True)
def setUp(self): # disabling logs logging.disable(logging.CRITICAL) self.app = app.test_client() # connecting to the database db.connect() # creating tables db.create_tables([User], safe=True) db.create_tables([State], safe=True) db.create_tables([City], safe=True) db.create_tables([Place], safe=True) db.create_tables([PlaceBook], safe=True) # Creating a setUp new_state = State(name='California') new_state.save() new_city = City(name='San Francisco', state=1) new_city.save() # Creating a new users user1 = User(first_name='Jon', last_name='Snow', email='jon@snow', password='******') user1.save() new_place = Place(owner=1, city=1, name="Steven", description="house", number_rooms=3, number_bathrooms=2, max_guest=3, price_by_night=100, latitude=37.774929, longitude=-122.419416) new_place.save()
def setUp(self): # disabling logs logging.disable(logging.CRITICAL) self.app = app.test_client() # connecting to the database db.connect() # creating tables db.create_tables([User], safe=True) db.create_tables([State], safe=True) db.create_tables([City], safe=True) db.create_tables([Place], safe=True) db.create_tables([PlaceBook], safe=True) # Creating a setUp new_state = State(name='California') new_state.save() new_city = City(name='San Francisco', state=1) new_city.save() # Creating a new users user1 = User(first_name='Jon', last_name='Snow', email='jon@snow', password='******') user1.save() new_place = Place(owner=1, city=1, name="Steven", description="house", number_rooms=3, number_bathrooms=2, max_guest=3, price_by_night=100, latitude=37.774929, longitude=-122.419416) new_place.save()
def setUp(self): self.app = app.test_client() logging.disable(logging.CRITICAL) # connecting to database db.connect() # creating a database db.create_tables([User], safe=True)
def setUp(self): # disabling logs # logging.disable(logging.CRITICAL) self.app = app.test_client() # connecting to the database db.connect() db.create_tables([State], safe=True) db.create_tables([City], safe=True)
def setUp(self): # logging.disable(logging.CRITICAL) self.app = app.test_client() db.connect() db.create_tables([User], safe=True) db.create_tables([State], safe=True) db.create_tables([City], safe=True) db.create_tables([Place], safe=True) db.create_tables([Amenity], safe=True) db.create_tables([PlaceAmenities], safe=True)
def setUp(self): self.app = app.test_client() logging.disable(logging.CRITICAL) # connectting to database db.connect() db.create_tables([User], safe=True) db.create_tables([State], safe=True) db.create_tables([City], safe=True) db.create_tables([Place], safe=True) db.create_tables([PlaceBook], safe=True)
def setUp(self): # logging.disable(logging.CRITICAL) self.app = app.test_client() db.connect() db.create_tables([User], safe=True) db.create_tables([State], safe=True) db.create_tables([City], safe=True) db.create_tables([Place], safe=True) db.create_tables([Amenity], safe=True) db.create_tables([PlaceAmenities], safe=True)
def setUp(self): self.app = app.test_client() logging.disable(logging.CRITICAL) # connectting to database db.connect() db.create_tables([User], safe=True) db.create_tables([State], safe=True) db.create_tables([City], safe=True) db.create_tables([Place], safe=True) db.create_tables([PlaceBook], safe=True)
def setUp(self): self.app = app.test_client() # logging.disable(logging.CRITICAL) # connectting to database db.connect() db.create_tables([User], safe=True) db.create_tables([State], safe=True) db.create_tables([City], safe=True) db.create_tables([Place], safe=True) db.create_tables([Review], safe=True) db.create_tables([ReviewUser], safe=True) db.create_tables([ReviewPlace], safe=True) # Creating a new users user1 = User(first_name='Jon', last_name='Snow', email='jon@snow', password='******') user1.save() user2 = User(first_name='Steven', last_name='Garcia', email='SG@snow', password='******') user2.save()
def before_request(): db.connect()
def setUp(self): db.connect() db.create_tables([User, State, City, Place, Review, ReviewUser, ReviewPlace], safe=True) logging.disable(logging.CRITICAL) self.app = app.test_client()
def setUp(self): db.connect() db.create_tables([State, City, User, Place, Amenity, PlaceAmenities], safe=True) logging.disable(logging.CRITICAL) self.app = app.test_client()
def setUp(self): db.connect() db.create_tables([User, State, City, PlaceBook, Place]) logging.disable(logging.CRITICAL) self.app = app.test_client()
from app.models.base import db from app.models.user import User from app.models.city import City from app.models.state import State from app.models.place import Place from app.models.place_book import PlaceBook from app.models.amenity import Amenity from app.models.place_amenity import PlaceAmenities from app.models.review import Review from app.models.review_place import ReviewPlace from app.models.review_user import ReviewUser ''' Initializes each table in the database ''' db.connect() db.create_tables([User,State,City,Place,Amenity,PlaceBook,PlaceAmenities,Review,ReviewPlace,ReviewUser], safe=True) db.close()
def setUp(self): db.connect() db.create_tables([City, State], safe=True) logging.disable(logging.CRITICAL) self.app = app.test_client()
def before_request(): db.connect()