Esempio n. 1
0
    def cleanup_db(self):

        for model in [
                MessengerSubscriber, MessengerMessage, MessengerNotification,
                MessengerPhoneNumber, MessengerClient
        ]:
            test_util.cleanup_model(model)
Esempio n. 2
0
    def test_send_messages_no_notifications(self):

        test_util.cleanup_model(MessengerMessage)
        test_util.cleanup_model(MessengerNotification)

        setup_subscriber()

        messages_meta = send_messages(client_name='Elections',
                                      day=date(2019, 11, 5))
        self.assertEqual(
            '\nclient: Elections\nday:    2019-11-05\n\nnotifications:  (No notifications sent)',
            messages_meta.describe(), "No messages can be sent")
Esempio n. 3
0
    def test_send_messages_no_message(self):
        "Test sending a message with no message set in database"

        test_util.cleanup_model(MessengerMessage)

        setup_subscriber()

        out = StringIO()
        with self.assertRaises(NotificationException):

            call_command('send_messages',
                         'Elections',
                         '--today=20191105',
                         stdout=out)
def cleanup_db():
    test_util.cleanup_model(DataValue)
    test_util.cleanup_model(DataSource)
    test_util.cleanup_model(DataCitySummary)
    test_util.cleanup_model(DataSet)

    SimpleJSONCache.clear_all()
Esempio n. 5
0
def cleanup_db():
    test_util.cleanup_model(Tblztickets)
Esempio n. 6
0
 def cleanup_db(self):
     test_util.cleanup_model(LicensePlateInfo)
def cleanup_db():
    test_util.cleanup_model(ScheduleDetail)
 def cleanup_db(self):
     test_util.cleanup_model(EscrowBalance)
 def cleanup_db(self):
     test_util.cleanup_model(DTEActiveGasSite)
def cleanup_db():
    test_util.cleanup_model(WasteItem)
Esempio n. 11
0
    def setUp(self):
        """
        Set up each unit test, including making sure database is properly cleaned up before each test
        """

        test_util.cleanup_model(MessengerSubscriber)
Esempio n. 12
0
    def tearDown(self):

        test_util.cleanup_model(DataValue)
        test_util.cleanup_model(DataSource)
        test_util.cleanup_model(DataSet)
Esempio n. 13
0
    def setUp(self):

        test_util.cleanup_model(DataValue)
        test_util.cleanup_model(DataSource)
        test_util.cleanup_model(DataSet)
Esempio n. 14
0
def cleanup_db():
    test_util.cleanup_model(Subscriber)