Esempio n. 1
0
    def test_bother_the_user(self):
        self.assertEqual(0, Message.objects.count(), 'Messages should not exist before call')
        from iondb.bin.startup_housekeeping import bother_the_user
        bother_the_user()
        self.assertEqual(1, Message.objects.count(), 'Messages should not exist after call')
        msg = Message.objects.latest('time')
        self.assertEqual("""Please supply some customer support contact info.
<br/><a href="/rundb/config">Add contact information.</a>""", msg.body, 'expecting different Message.body')
Esempio n. 2
0
    def test_bother_the_user(self):
#        UserProfile.objects.create(user=self.lab_contact, name="Lab Contact")
#        UserProfile.objects.create(user=self.it_contact, name="IT Contact")
        logger.debug('Found %s UserProfile.objects.count()' % UserProfile.objects.count())
        
        self.assertEqual(0, Message.objects.count(), 'Messages should not exist before call')
        from iondb.bin.startup_housekeeping import bother_the_user
        bother_the_user()
        self.assertEqual(0, Message.objects.count(), 'Messages should not exist after call')