def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() db.create_all() self.client = self.app.test_client() self.report_1 = Report(name='Phil', lat=3.123123, long=3.345345, description="some crazy stuff happened", event_type="abduction", image="image.com", city="Greeley", state="CO") self.report_1.insert()
def test_report_model_missing_lat(self): try: report = Report(name='Mark Zuckerberg', lat=None, long=3.345, city='Roswell', state='NM', description="I am your reptilian overloard!", event_type="encounter", image="pics.com") report.insert() except IntegrityError: self.assertTrue(True) else: # we should not end up in here self.assertTrue(False) # pragma: no cover
def test_report_model_missing_image(self): try: report = Report(name='Mark Zuckerberg', lat=3.123, long=3.345, city='Roswell', state='NM', description='I am your reptilian overloard!', event_type='abduction', image=None) report.insert() except IntegrityError: self.assertTrue(False) else: # we should not end up in here self.assertTrue(True) # pragma: no cover
def test_report_model_blank_description(self): try: report = Report(name='Mark Zuckerberg', lat=3.123, long=3.345, city='Roswell', state='NM', description='', event_type="encounter", image="pics.com") report.insert() except IntegrityError: self.assertTrue(True) else: # we should not end up in here self.assertTrue(False) # pragma: no cover
def _create_report(self, data): proceed = True errors = [] proceed, report_event_type, errors = _validate_field( data, 'event_type', proceed, errors) proceed, report_description, errors = _validate_field( data, 'description', proceed, errors) proceed, report_lat, errors = _validate_field(data, 'lat', proceed, errors) proceed, report_long, errors = _validate_field(data, 'long', proceed, errors) proceed, report_city, errors = _validate_field(data, 'city', proceed, errors) proceed, report_state, errors = _validate_field( data, 'state', proceed, errors) if proceed: report = Report(name=data['name'], lat=data['lat'], long=data['long'], event_type=data['event_type'], description=data['description'], image=data['image'], city=data['city'], state=data['state']) db.session.add(report) db.session.commit() return report, errors else: return None, errors
def test_report_model_missing_name_will_be_stored_as_anonymous(self): try: report = Report(name=None, lat=3.123, long=3.345, city='Roswell', state='NM', description="I am your reptilian overloard!", event_type="encounter", image="pics.com") report.insert() db.session.query(Report).filter_by(name='anonymous').first() except IntegrityError: self.assertTrue(False) else: # we should not end up in here self.assertTrue(True) # pragma: no cover
def test_report_model(self): report = Report(name='Mark Zuckerberg', lat=3.123, long=3.345, city='Roswell', state='NM', description="I am your reptilian overloard!", event_type="encounter", image="pics.com") report.insert() self.assertIsInstance(report, Report) self.assertIsNotNone(report.id) self.assertEqual('Mark Zuckerberg', report.name) self.assertEqual(3.123, report.lat) self.assertEqual(3.345, report.long) self.assertEqual("I am your reptilian overloard!", report.description) self.assertEqual("encounter", report.event_type) self.assertEqual("pics.com", report.image)
class DeleteReportTest(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() db.create_all() self.client = self.app.test_client() self.report_1 = Report(name='Phil', lat=3.123123, long=3.345345, description="some crazy stuff happened", event_type="abduction", image="image.com", city="Greeley", state="CO") self.report_1.insert() def tearDown(self): db.session.remove() db_drop_everything(db) self.app_context.pop() def test_happypath_delete_a_report(self): response = self.client.delete(f'/api/v1/reports/{self.report_1.id}') self.assertEqual(204, response.status_code) self.assertEqual('', response.data.decode('utf-8')) # ensure it's really gone by getting a 404 if we try to fetch it again response = self.client.get(f'/api/v1/reports/{self.report_1.id}') self.assertEqual(404, response.status_code) def test_sadpath_delete_bad_id_report(self): response = self.client.delete(f'/api/v1/reports/9999999') self.assertEqual(404, response.status_code) data = json.loads(response.data.decode('utf-8')) assert_payload_field_type_value(self, data, 'error', int, 404) assert_payload_field_type_value(self, data, 'success', bool, False) assert_payload_field_type_value(self, data, 'message', str, 'resource not found')
def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() db.create_all() self.client = self.app.test_client() self.report_1 = Report(name='Mark Zuckerberg', lat=3.123, long=3.345, city='Roswell', state='NM', description="I am your reptilian overloard!", event_type="encounter", image="pics.com") self.comment_1 = Comment(text="Then where's your ship?", report_id={self.report_1.id}) self.report_1.comments.append(self.comment_1) db.session.add(self.report_1) db.session.commit()
def test_happypath_get_all_reports(self): report_1 = Report( name='Will Smith', lat=3.123123, long=3.345345, city='Roswell', state='NM', description="Halle Berry was an alien the whole time", event_type="encounter", image="pics.com") report_1.insert() report_2 = Report(name='Mark Zuckerberg', lat=3.123123, long=3.345345, city='Roswell', state='NM', description="I am your reptilian overloard!", event_type="encounter", image="pics.com") report_2.insert() response = self.client.get(f'/api/v1/reports') self.assertEqual(200, response.status_code) data = json.loads(response.data.decode('utf-8')) assert_payload_field_type_value(self, data, 'success', bool, True) assert_payload_field_type(self, data, 'results', list) results = data['results'] # we expect report 2 first to ensure we're getting results in # ascending alphabetical order by name next_result = results[0] assert_payload_field_type_value(self, next_result, 'name', str, report_2.name) assert_payload_field_type_value(self, next_result, 'lat', float, report_2.lat) assert_payload_field_type_value(self, next_result, 'long', float, report_2.long) assert_payload_field_type_value(self, next_result, 'description', str, report_2.description) assert_payload_field_type_value(self, next_result, 'event_type', str, report_2.event_type) assert_payload_field_type_value(self, next_result, 'image', str, report_2.image) report_id = next_result['id'] assert_payload_field_type(self, next_result, 'links', dict) links = next_result['links'] assert_payload_field_type_value(self, links, 'get', str, f'/api/v1/reports/{report_id}') assert_payload_field_type_value(self, links, 'patch', str, f'/api/v1/reports/{report_id}') assert_payload_field_type_value(self, links, 'delete', str, f'/api/v1/reports/{report_id}') assert_payload_field_type_value(self, links, 'index', str, '/api/v1/reports') next_result = results[1] assert_payload_field_type_value(self, next_result, 'name', str, report_1.name) assert_payload_field_type_value(self, next_result, 'lat', float, report_1.lat) assert_payload_field_type_value(self, next_result, 'lat', float, report_1.lat) assert_payload_field_type_value(self, next_result, 'event_type', str, report_1.event_type) assert_payload_field_type_value(self, next_result, 'description', str, report_1.description) assert_payload_field_type_value(self, next_result, 'image', str, report_1.image) report_id = next_result['id'] assert_payload_field_type(self, next_result, 'links', dict)
def db_seed(): db_drop_everything(db) db.create_all() #Denver Area: # +1 days ago: report1 = Report(name='', lat=39.3912345, long=-104.5212345, description='Saw some stuff', event_type='sighting', city="Ponderosa Park", state="CO", image='example_image.com', created_at=datetime(2021, 2, 28, 12, 00)) report2 = Report(name='Phil', lat=40.4312345, long=-104.4012345, description='Saw some stuff', event_type='sighting', city="Kersey", state="CO", image='example_image.com', created_at=datetime(2021, 2, 28, 12, 00)) report3 = Report( name='', lat=39.7112345, long=-103.5612345, description='Saw some stuff', event_type='sighting', city="Last Chance", state="CO", image='https://s.hdnux.com/photos/01/00/16/14/16835374/9/1200x0.jpg', created_at=datetime(2021, 2, 27, 14, 00)) report4 = Report( name='Phil', lat=39.4512345, long=-105.5212345, description='Saw some stuff', event_type='sighting', city="Bailey", state="CO", image='https://s.hdnux.com/photos/01/00/16/14/16835374/9/1200x0.jpg', created_at=datetime(2021, 2, 28, 15, 00)) report5 = Report( name='Austin', lat=39.4512345, long=-104.0812345, description='talked to some greys', event_type='contact', city="Agate", state="CO", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 26, 16, 00)) report6 = Report( name='', lat=39.3912345, long=-104.4612345, description='talked to some greys', event_type='contact', city="Kiowa", state="CO", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 26, 17, 00)) report7 = Report( name='Austin', lat=39.3712345, long=-104.5412345, description='talked to some greys', event_type='contact', city="Ponderosa Park", state="CO", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 28, 18, 00)) report8 = Report( name='', lat=39.4112345, long=-104.4412345, description='talked to some greys', event_type='contact', city="Kiowa", state="CO", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 27, 19, 00)) # +8 days ago report9 = Report( name='Hanna', lat=39.6312345, long=-104.9812345, description='it was chill', event_type='abduction', city="Englewood", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 21, 12, 00)) report10 = Report( name='', lat=39.5712345, long=-104.9012345, description='it was chill', event_type='abduction', city="Centennial", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 20, 13, 00)) report11 = Report( name='Hanna', lat=39.6512345, long=-105.1612345, description='it was chill', event_type='abduction', city="Lakewood", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 21, 14, 00)) report12 = Report( name='', lat=39.6312345, long=-105.2412345, description='it was chill', event_type='abduction', city="Indian Hills", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 19, 15, 00)) report13 = Report( name='Todd', lat=39.3922345, long=-104.4412345, description='it was chill', event_type='abduction', city="Kiowa", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 21, 16, 00)) report14 = Report( name='', lat=39.3932345, long=-104.0412345, description='it was chill', event_type='abduction', city="Agate", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 20, 17, 00)) report15 = Report( name='Todd', lat=39.3942345, long=-104.4412345, description='it was chill', event_type='abduction', city="Kiowa", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 19, 18, 00)) report16 = Report( name='', lat=39.2052345, long=-104.3112345, description='it was chill', event_type='abduction', city="Fondis", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 21, 19, 00)) # +30 days ago: report17 = Report( name='Hanna', lat=39.6442345, long=-104.8892345, description='it was chill', event_type='abduction', city="Denver", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 31, 12, 00)) report18 = Report( name='', lat=39.7622345, long=-104.7892345, description='it was chill', event_type='abduction', city="Aurora", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 30, 13, 00)) report19 = Report( name='Hanna', lat=39.5532345, long=-104.8752345, description='it was chill', event_type='abduction', city="Lone Tree", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 29, 14, 00)) report20 = Report( name='', lat=39.6362345, long=-104.3392345, description='it was chill', event_type='abduction', city="Strasburg", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 28, 15, 00)) report21 = Report( name='Todd', lat=39.4882345, long=-104.7642345, description='it was chill', event_type='abduction', city="Parker", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 27, 16, 00)) report22 = Report( name='', lat=39.3802345, long=-104.4262345, description='it was chill', event_type='abduction', city="Kiowa", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 26, 17, 00)) report23 = Report( name='Todd', lat=39.3872345, long=-104.4392345, description='it was chill', event_type='abduction', city="Kiowa", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 25, 18, 00)) report24 = Report( name='', lat=38.3902345, long=-104.4499345, description='it was chill', event_type='abduction', city="Pueblo", state="CO", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 24, 19, 00)) #Nashville area: # +1 days ago: report25 = Report( name='Phil', lat=36.3912345, long=-86.7212345, description='Saw some stuff', event_type='sighting', city="Millersville", state="TN", image='https://s.hdnux.com/photos/01/00/16/14/16835374/9/1200x0.jpg', created_at=datetime(2021, 2, 28, 12, 00)) report26 = Report( name='', lat=36.2312345, long=-86.7012345, description='Saw some stuff', event_type='sighting', city="Nashville", state="TN", image='https://s.hdnux.com/photos/01/00/16/14/16835374/9/1200x0.jpg', created_at=datetime(2021, 2, 27, 13, 00)) report27 = Report( name='Phil', lat=36.4112345, long=-86.7612345, description='Saw some stuff', event_type='sighting', city="Ridgetop", state="TN", image='https://s.hdnux.com/photos/01/00/16/14/16835374/9/1200x0.jpg', created_at=datetime(2021, 2, 26, 14, 00)) report28 = Report( name='', lat=36.2512345, long=-86.7212345, description='Saw some stuff', event_type='sighting', city="Madison", state="TN", image='https://s.hdnux.com/photos/01/00/16/14/16835374/9/1200x0.jpg', created_at=datetime(2021, 2, 28, 15, 00)) report29 = Report( name='Austin', lat=36.2512345, long=-86.7812345, description='talked to some greys', event_type='contact', city="Nashville", state="TN", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 27, 16, 00)) report30 = Report( name='', lat=36.1912345, long=-86.5612345, description='talked to some greys', event_type='contact', city="Mt. Juliet", state="TN", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 26, 17, 00)) report31 = Report( name='Austin', lat=36.1712345, long=-86.7412345, description='talked to some greys', event_type='contact', city="Nashville", state="TN", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 28, 18, 00)) report32 = Report( name='', lat=36.0012345, long=-86.6912345, description='talked to some greys', event_type='contact', city="Nashville", state="TN", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 27, 19, 00)) # +8 days ago report33 = Report( name='Hanna', lat=36.5312345, long=-86.7812345, description='it was chill', event_type='abduction', city="Cross Plains", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 21, 12, 00)) report34 = Report( name='', lat=35.1712345, long=-86.6812345, description='it was chill', event_type='abduction', city="Fayetteville", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 20, 13, 00)) report35 = Report( name='Hanna', lat=36.1512345, long=-87.6612345, description='it was chill', event_type='abduction', city="McEwen", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 20, 14, 00)) report36 = Report( name='', lat=36.1312345, long=-86.6412345, description='it was chill', event_type='abduction', city="Nashville", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 19, 15, 00)) report37 = Report( name='Todd', lat=36.3922345, long=-86.4412345, description='it was chill', event_type='abduction', city="Gallatin", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 20, 16, 00)) report38 = Report( name='', lat=36.3132345, long=-86.4012345, description='it was chill', event_type='abduction', city="Gallatin", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 21, 17, 00)) report39 = Report( name='Todd', lat=36.4942345, long=-86.4412345, description='it was chill', event_type='abduction', city="Graball", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 21, 18, 00)) report40 = Report( name='', lat=36.3952345, long=-86.4412345, description='it was chill', event_type='abduction', city="Gallatin", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 19, 19, 00)) #30 days ago report41 = Report( name='Hanna', lat=36.3362345, long=-86.4412345, description='it was chill', event_type='abduction', city="Gallatin", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 31, 12, 00)) report42 = Report( name='', lat=36.3752345, long=-85.4312345, description='it was chill', event_type='abduction', city="Livingston", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 30, 13, 00)) report43 = Report( name='Hanna', lat=35.3552345, long=-87.4312345, description='it was chill', event_type='abduction', city="Lawrenceburg", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 29, 14, 00)) report44 = Report( name='', lat=36.3012345, long=-86.4112345, description='it was chill', event_type='abduction', city="Gallatin", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 28, 15, 00)) report45 = Report( name='Todd', lat=34.3992345, long=-88.4812345, description='it was chill', event_type='abduction', city="Mantachie", state="MS", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 27, 16, 00)) report46 = Report( name='', lat=37.3652345, long=-85.4012345, description='it was chill', event_type='abduction', city="Campbellsville", state="KY", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 26, 17, 00)) report47 = Report( name='Todd', lat=36.1992345, long=-86.0372345, description='it was chill', event_type='abduction', city="New Middleton", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 25, 18, 00)) report48 = Report( name='', lat=35.3752345, long=-85.4452345, description='it was chill', event_type='abduction', city="Dunlap", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 24, 19, 00)) #Portland Area # +1 days ago: 33.3943, 104.5230 report49 = Report( name='Phil', lat=33.3943, long=-104.5230, description='Saw some stuff', event_type='sighting', city="Roswell", state="NM", image='https://s.hdnux.com/photos/01/00/16/14/16835374/9/1200x0.jpg', created_at=datetime(2021, 2, 28, 12, 00)) report50 = Report( name='', lat=33.3943, long=-104.6230, description='Saw some stuff', event_type='sighting', city="Roswell", state="NM", image='https://s.hdnux.com/photos/01/00/16/14/16835374/9/1200x0.jpg', created_at=datetime(2021, 2, 27, 13, 00)) report51 = Report( name='Phil', lat=33.4943, long=-104.5230, description='Saw some stuff', event_type='sighting', city="Roswell", state="NM", image='https://s.hdnux.com/photos/01/00/16/14/16835374/9/1200x0.jpg', created_at=datetime(2021, 2, 26, 14, 00)) report52 = Report( name='', lat=33.3943, long=-104.6030, description='Saw some stuff', event_type='sighting', city="Roswell", state="NM", image='https://s.hdnux.com/photos/01/00/16/14/16835374/9/1200x0.jpg', created_at=datetime(2021, 2, 28, 15, 00)) report53 = Report( name='Austin', lat=33.4543, long=-104.5230, description='talked to some greys', event_type='contact', city="Roswell", state="NM", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 27, 16, 00)) report54 = Report( name='', lat=33.2943, long=-104.5230, description='talked to some greys', event_type='contact', city="Roswell", state="NM", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 26, 17, 00)) report55 = Report( name='Austin', lat=33.3843, long=-104.4930, description='talked to some greys', event_type='contact', city="Roswell", state="NM", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 28, 18, 00)) report56 = Report( name='', lat=33.3743, long=-104.5030, description='talked to some greys', event_type='contact', city="Roswell", state="NM", image= 'https://astronomy.com/-/media/Images/News%20and%20Observing/News/2020/10/UFOMeersburg.jpg?mw=600', created_at=datetime(2021, 2, 27, 19, 00)) # +8 days ago report57 = Report( name='Hanna', lat=33.2943, long=-104.7230, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 21, 12, 00)) report58 = Report( name='', lat=33.4143, long=-104.7030, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 20, 13, 00)) report59 = Report( name='Hanna', lat=33.4243, long=-104.6930, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 20, 14, 00)) report60 = Report( name='', lat=33.4343, long=-104.5030, description='it was chill', event_type='abduction', city="Roswelll", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 19, 15, 00)) report61 = Report( name='Todd', lat=33.3243, long=-104.5630, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 20, 16, 00)) report62 = Report( name='', lat=33.2743, long=-104.4530, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 21, 17, 00)) report63 = Report( name='Todd', lat=33.5643, long=-104.4830, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 21, 18, 00)) report64 = Report( name='', lat=33.4043, long=-104.4230, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 2, 19, 19, 00)) # 30 days ago report65 = Report( name='Hanna', lat=33.3643, long=-104.5130, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 31, 12, 00)) report66 = Report( name='', lat=33.3043, long=-104.5230, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 30, 13, 00)) report67 = Report( name='Hanna', lat=33.3543, long=-104.6330, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 29, 14, 00)) report68 = Report( name='', lat=33.4743, long=-104.4230, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 28, 15, 00)) report69 = Report( name='Todd', lat=33.4243, long=-104.4730, description='it was chill', event_type='abduction', city="Roswell", state="MS", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 27, 16, 00)) report70 = Report( name='', lat=33.3043, long=-104.5030, description='it was chill', event_type='abduction', city="Roswell", state="KY", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 26, 17, 00)) report71 = Report( name='Todd', lat=33.3243, long=-104.5630, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 25, 18, 00)) report72 = Report( name='', lat=33.3143, long=-104.4530, description='it was chill', event_type='abduction', city="Roswell", state="TN", image='https://s.hdnux.com/photos/77/16/41/16574564/4/1200x0.jpg', created_at=datetime(2021, 1, 24, 19, 00)) db.session.add(report1) db.session.add(report2) db.session.add(report3) db.session.add(report4) db.session.add(report5) db.session.add(report6) db.session.add(report7) db.session.add(report8) db.session.add(report9) db.session.add(report10) db.session.add(report11) db.session.add(report12) db.session.add(report13) db.session.add(report14) db.session.add(report15) db.session.add(report16) db.session.add(report17) db.session.add(report18) db.session.add(report19) db.session.add(report20) db.session.add(report21) db.session.add(report22) db.session.add(report23) db.session.add(report24) db.session.add(report25) db.session.add(report26) db.session.add(report27) db.session.add(report28) db.session.add(report29) db.session.add(report30) db.session.add(report31) db.session.add(report32) db.session.add(report33) db.session.add(report34) db.session.add(report35) db.session.add(report36) db.session.add(report37) db.session.add(report38) db.session.add(report39) db.session.add(report40) db.session.add(report41) db.session.add(report42) db.session.add(report43) db.session.add(report44) db.session.add(report45) db.session.add(report46) db.session.add(report47) db.session.add(report48) db.session.add(report49) db.session.add(report50) db.session.add(report51) db.session.add(report52) db.session.add(report53) db.session.add(report54) db.session.add(report55) db.session.add(report56) db.session.add(report57) db.session.add(report58) db.session.add(report59) db.session.add(report60) db.session.add(report61) db.session.add(report62) db.session.add(report63) db.session.add(report64) db.session.add(report65) db.session.add(report66) db.session.add(report67) db.session.add(report68) db.session.add(report69) db.session.add(report70) db.session.add(report71) db.session.add(report72) db.session.commit() comment1 = Comment(report_id=report1.id, text="that's crazy dude") comment2 = Comment(report_id=report1.id, text="the truth is out there") comment65 = Comment(report_id=report1.id, text="fake news") comment66 = Comment(report_id=report1.id, text="sounds legit") comment67 = Comment(report_id=report1.id, text="whaaaaaaat") comment73 = Comment(report_id=report1.id, text="wild") comment3 = Comment(report_id=report2.id, text="that's crazy dude") comment4 = Comment(report_id=report2.id, text="the truth is out there") comment5 = Comment(report_id=report3.id, text="that's crazy dude") comment6 = Comment(report_id=report3.id, text="the truth is out there") comment7 = Comment(report_id=report4.id, text="that's crazy dude") comment8 = Comment(report_id=report4.id, text="the truth is out there") comment68 = Comment(report_id=report4.id, text="incredible") comment69 = Comment(report_id=report4.id, text="im jealous") comment9 = Comment(report_id=report5.id, text="that's crazy dude") comment10 = Comment(report_id=report5.id, text="the truth is out there") comment11 = Comment(report_id=report6.id, text="that's crazy dude") comment12 = Comment(report_id=report6.id, text="the truth is out there") comment13 = Comment(report_id=report7.id, text="that's crazy dude") comment70 = Comment(report_id=report7.id, text="I want to believe") comment71 = Comment(report_id=report7.id, text="I do believe") comment14 = Comment(report_id=report7.id, text="the truth is out there") comment15 = Comment(report_id=report8.id, text="that's crazy dude") comment16 = Comment(report_id=report8.id, text="the truth is out there") comment17 = Comment(report_id=report9.id, text="that's crazy dude") comment18 = Comment(report_id=report9.id, text="the truth is out there") comment19 = Comment(report_id=report10.id, text="that's crazy dude") comment72 = Comment(report_id=report10.id, text="sure") comment20 = Comment(report_id=report10.id, text="the truth is out there") comment21 = Comment(report_id=report11.id, text="that's crazy dude") comment22 = Comment(report_id=report11.id, text="the truth is out there") comment23 = Comment(report_id=report12.id, text="that's crazy dude") comment24 = Comment(report_id=report12.id, text="the truth is out there") comment25 = Comment(report_id=report13.id, text="that's crazy dude") comment26 = Comment(report_id=report13.id, text="the truth is out there") comment27 = Comment(report_id=report14.id, text="that's crazy dude") comment28 = Comment(report_id=report14.id, text="the truth is out there") comment29 = Comment(report_id=report15.id, text="that's crazy dude") comment30 = Comment(report_id=report15.id, text="the truth is out there") comment31 = Comment(report_id=report16.id, text="that's crazy dude") comment32 = Comment(report_id=report16.id, text="the truth is out there") comment33 = Comment(report_id=report17.id, text="that's crazy dude") comment34 = Comment(report_id=report17.id, text="the truth is out there") comment35 = Comment(report_id=report18.id, text="that's crazy dude") comment36 = Comment(report_id=report18.id, text="the truth is out there") comment37 = Comment(report_id=report19.id, text="that's crazy dude") comment38 = Comment(report_id=report19.id, text="the truth is out there") comment39 = Comment(report_id=report20.id, text="that's crazy dude") comment40 = Comment(report_id=report20.id, text="the truth is out there") comment41 = Comment(report_id=report21.id, text="that's crazy dude") comment42 = Comment(report_id=report21.id, text="the truth is out there") comment43 = Comment(report_id=report22.id, text="that's crazy dude") comment44 = Comment(report_id=report22.id, text="the truth is out there") comment45 = Comment(report_id=report23.id, text="that's crazy dude") comment46 = Comment(report_id=report23.id, text="the truth is out there") comment47 = Comment(report_id=report24.id, text="that's crazy dude") comment48 = Comment(report_id=report24.id, text="the truth is out there") comment49 = Comment(report_id=report25.id, text="that's crazy dude") comment50 = Comment(report_id=report25.id, text="the truth is out there") comment51 = Comment(report_id=report26.id, text="that's crazy dude") comment52 = Comment(report_id=report26.id, text="the truth is out there") comment53 = Comment(report_id=report27.id, text="that's crazy dude") comment54 = Comment(report_id=report27.id, text="the truth is out there") comment55 = Comment(report_id=report28.id, text="that's crazy dude") comment56 = Comment(report_id=report28.id, text="the truth is out there") comment57 = Comment(report_id=report29.id, text="that's crazy dude") comment58 = Comment(report_id=report29.id, text="the truth is out there") comment59 = Comment(report_id=report30.id, text="that's crazy dude") comment60 = Comment(report_id=report30.id, text="the truth is out there") comment61 = Comment(report_id=report31.id, text="that's crazy dude") comment62 = Comment(report_id=report31.id, text="the truth is out there") comment63 = Comment(report_id=report32.id, text="that's crazy dude") comment64 = Comment(report_id=report32.id, text="the truth is out there") comment74 = Comment(report_id=report33.id, text="that's crazy dude") comment75 = Comment(report_id=report33.id, text="the truth is out there") comment76 = Comment(report_id=report34.id, text="that's crazy dude") comment77 = Comment(report_id=report34.id, text="the truth is out there") comment78 = Comment(report_id=report35.id, text="that's crazy dude") comment79 = Comment(report_id=report35.id, text="the truth is out there") comment80 = Comment(report_id=report36.id, text="that's crazy dude") comment81 = Comment(report_id=report36.id, text="the truth is out there") comment82 = Comment(report_id=report37.id, text="that's crazy dude") comment83 = Comment(report_id=report37.id, text="the truth is out there") comment84 = Comment(report_id=report38.id, text="that's crazy dude") comment85 = Comment(report_id=report38.id, text="the truth is out there") comment86 = Comment(report_id=report39.id, text="that's crazy dude") comment87 = Comment(report_id=report39.id, text="the truth is out there") comment88 = Comment(report_id=report40.id, text="that's crazy dude") comment89 = Comment(report_id=report40.id, text="the truth is out there") comment90 = Comment(report_id=report41.id, text="that's crazy dude") comment91 = Comment(report_id=report41.id, text="the truth is out there") comment92 = Comment(report_id=report42.id, text="that's crazy dude") comment93 = Comment(report_id=report42.id, text="the truth is out there") comment94 = Comment(report_id=report43.id, text="that's crazy dude") comment95 = Comment(report_id=report43.id, text="the truth is out there") comment96 = Comment(report_id=report44.id, text="that's crazy dude") comment97 = Comment(report_id=report44.id, text="the truth is out there") comment98 = Comment(report_id=report45.id, text="that's crazy dude") comment99 = Comment(report_id=report45.id, text="the truth is out there") comment100 = Comment(report_id=report46.id, text="that's crazy dude") comment101 = Comment(report_id=report46.id, text="the truth is out there") comment102 = Comment(report_id=report47.id, text="that's crazy dude") comment103 = Comment(report_id=report47.id, text="the truth is out there") comment104 = Comment(report_id=report48.id, text="that's crazy dude") comment105 = Comment(report_id=report48.id, text="the truth is out there") comment106 = Comment(report_id=report49.id, text="that's crazy dude") comment107 = Comment(report_id=report49.id, text="the truth is out there") comment108 = Comment(report_id=report50.id, text="that's crazy dude") comment109 = Comment(report_id=report50.id, text="the truth is out there") comment110 = Comment(report_id=report51.id, text="that's crazy dude") comment111 = Comment(report_id=report51.id, text="the truth is out there") comment112 = Comment(report_id=report52.id, text="that's crazy dude") comment113 = Comment(report_id=report52.id, text="the truth is out there") comment114 = Comment(report_id=report53.id, text="that's crazy dude") comment115 = Comment(report_id=report53.id, text="the truth is out there") comment116 = Comment(report_id=report54.id, text="that's crazy dude") comment117 = Comment(report_id=report54.id, text="the truth is out there") comment118 = Comment(report_id=report55.id, text="that's crazy dude") comment119 = Comment(report_id=report55.id, text="the truth is out there") comment120 = Comment(report_id=report56.id, text="that's crazy dude") comment121 = Comment(report_id=report56.id, text="the truth is out there") comment122 = Comment(report_id=report57.id, text="that's crazy dude") comment123 = Comment(report_id=report57.id, text="the truth is out there") comment124 = Comment(report_id=report58.id, text="that's crazy dude") comment125 = Comment(report_id=report58.id, text="the truth is out there") comment126 = Comment(report_id=report59.id, text="that's crazy dude") comment127 = Comment(report_id=report59.id, text="the truth is out there") comment128 = Comment(report_id=report60.id, text="that's crazy dude") comment129 = Comment(report_id=report60.id, text="the truth is out there") comment130 = Comment(report_id=report61.id, text="that's crazy dude") comment131 = Comment(report_id=report61.id, text="the truth is out there") comment132 = Comment(report_id=report62.id, text="that's crazy dude") comment133 = Comment(report_id=report62.id, text="the truth is out there") comment134 = Comment(report_id=report63.id, text="that's crazy dude") comment135 = Comment(report_id=report63.id, text="the truth is out there") comment136 = Comment(report_id=report64.id, text="that's crazy dude") comment137 = Comment(report_id=report64.id, text="the truth is out there") comment138 = Comment(report_id=report65.id, text="that's crazy dude") comment139 = Comment(report_id=report65.id, text="the truth is out there") comment140 = Comment(report_id=report47.id, text="that's crazy dude") comment141 = Comment(report_id=report66.id, text="the truth is out there") comment142 = Comment(report_id=report66.id, text="that's crazy dude") comment143 = Comment(report_id=report67.id, text="the truth is out there") comment144 = Comment(report_id=report67.id, text="that's crazy dude") comment145 = Comment(report_id=report68.id, text="the truth is out there") comment146 = Comment(report_id=report68.id, text="that's crazy dude") comment147 = Comment(report_id=report69.id, text="the truth is out there") comment148 = Comment(report_id=report69.id, text="that's crazy dude") comment149 = Comment(report_id=report70.id, text="the truth is out there") db.session.add(comment1) db.session.add(comment2) db.session.add(comment3) db.session.add(comment4) db.session.add(comment5) db.session.add(comment6) db.session.add(comment7) db.session.add(comment8) db.session.add(comment9) db.session.add(comment10) db.session.add(comment11) db.session.add(comment12) db.session.add(comment13) db.session.add(comment14) db.session.add(comment15) db.session.add(comment16) db.session.add(comment17) db.session.add(comment18) db.session.add(comment19) db.session.add(comment20) db.session.add(comment21) db.session.add(comment22) db.session.add(comment23) db.session.add(comment24) db.session.add(comment25) db.session.add(comment26) db.session.add(comment27) db.session.add(comment28) db.session.add(comment29) db.session.add(comment30) db.session.add(comment31) db.session.add(comment32) db.session.add(comment33) db.session.add(comment34) db.session.add(comment35) db.session.add(comment36) db.session.add(comment37) db.session.add(comment38) db.session.add(comment39) db.session.add(comment40) db.session.add(comment41) db.session.add(comment42) db.session.add(comment43) db.session.add(comment44) db.session.add(comment45) db.session.add(comment46) db.session.add(comment47) db.session.add(comment48) db.session.add(comment49) db.session.add(comment50) db.session.add(comment51) db.session.add(comment52) db.session.add(comment53) db.session.add(comment54) db.session.add(comment55) db.session.add(comment56) db.session.add(comment57) db.session.add(comment58) db.session.add(comment59) db.session.add(comment60) db.session.add(comment61) db.session.add(comment62) db.session.add(comment63) db.session.add(comment64) db.session.add(comment65) db.session.add(comment66) db.session.add(comment67) db.session.add(comment68) db.session.add(comment69) db.session.add(comment70) db.session.add(comment71) db.session.add(comment72) db.session.add(comment73) db.session.add(comment74) db.session.add(comment75) db.session.add(comment76) db.session.add(comment77) db.session.add(comment78) db.session.add(comment79) db.session.add(comment80) db.session.add(comment81) db.session.add(comment82) db.session.add(comment83) db.session.add(comment84) db.session.add(comment85) db.session.add(comment86) db.session.add(comment87) db.session.add(comment88) db.session.add(comment89) db.session.add(comment90) db.session.add(comment91) db.session.add(comment92) db.session.add(comment93) db.session.add(comment94) db.session.add(comment95) db.session.add(comment96) db.session.add(comment97) db.session.add(comment98) db.session.add(comment99) db.session.add(comment100) db.session.add(comment101) db.session.add(comment102) db.session.add(comment103) db.session.add(comment104) db.session.add(comment105) db.session.add(comment106) db.session.add(comment107) db.session.add(comment108) db.session.add(comment109) db.session.add(comment110) db.session.add(comment111) db.session.add(comment112) db.session.add(comment113) db.session.add(comment114) db.session.add(comment115) db.session.add(comment116) db.session.add(comment117) db.session.add(comment118) db.session.add(comment119) db.session.add(comment120) db.session.add(comment121) db.session.add(comment122) db.session.add(comment123) db.session.add(comment124) db.session.add(comment125) db.session.add(comment126) db.session.add(comment127) db.session.add(comment128) db.session.add(comment129) db.session.add(comment130) db.session.add(comment131) db.session.add(comment132) db.session.add(comment133) db.session.add(comment134) db.session.add(comment135) db.session.add(comment136) db.session.add(comment137) db.session.add(comment138) db.session.add(comment139) db.session.add(comment140) db.session.add(comment141) db.session.add(comment142) db.session.add(comment143) db.session.add(comment144) db.session.add(comment145) db.session.add(comment146) db.session.add(comment147) db.session.add(comment148) db.session.add(comment149) db.session.commit() print(f'obj count: {len(db.session.query(Report).all())}') print(f'obj count: {len(db.session.query(Comment).all())}')