def cleanup_db(self):

        for model in [
                MessengerSubscriber, MessengerMessage, MessengerNotification,
                MessengerPhoneNumber, MessengerClient
        ]:
            test_util.cleanup_model(model)
    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")
    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()
Exemple #5
0
def cleanup_db():
    test_util.cleanup_model(Tblztickets)
Exemple #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)
    def setUp(self):
        """
        Set up each unit test, including making sure database is properly cleaned up before each test
        """

        test_util.cleanup_model(MessengerSubscriber)
Exemple #12
0
    def tearDown(self):

        test_util.cleanup_model(DataValue)
        test_util.cleanup_model(DataSource)
        test_util.cleanup_model(DataSet)
Exemple #13
0
    def setUp(self):

        test_util.cleanup_model(DataValue)
        test_util.cleanup_model(DataSource)
        test_util.cleanup_model(DataSet)
Exemple #14
0
def cleanup_db():
    test_util.cleanup_model(Subscriber)