def test_agency_with_user_no_incident_report(self):
     Agency.insert_agencies()
     agency = Agency.get_agency_by_name('SEPTA')
     u1 = User(email='*****@*****.**', password='******')
     u2 = User(email='*****@*****.**', password='******')
     agency.users = [u1, u2]
     self.assertEqual(agency.name, 'SEPTA')
     self.assertTrue(agency.is_official)
     self.assertFalse(agency.is_public)
     self.assertEqual(agency.users, [u1, u2])
 def test_agency_with_incident_report_no_user(self):
     Agency.insert_agencies()
     agency = Agency.get_agency_by_name('SEPTA')
     incident1 = IncidentReport(description='Truck idling on the road!',
                                send_email_upon_creation=False)
     incident2 = IncidentReport(description='Another one!',
                                send_email_upon_creation=False)
     agency.incident_reports = [incident1, incident2]
     self.assertEqual(agency.name, 'SEPTA')
     self.assertTrue(agency.is_official)
     self.assertFalse(agency.is_public)
     self.assertEqual(agency.incident_reports, [incident1, incident2])
Ejemplo n.º 3
0
def setup_general():
    """Runs the set-up needed for both local development and production."""
    Role.insert_roles()
    Agency.insert_agencies()
    EditableHTML.add_default_faq()
 def test_agency_no_user_no_incident_report(self):
     Agency.insert_agencies()
     agency = Agency.get_agency_by_name('SEPTA')
     self.assertEqual(agency.name, 'SEPTA')
     self.assertTrue(agency.is_official)
     self.assertFalse(agency.is_public)