Example #1
0
    def get_data_for_voice(self):
        """
        Prepare OutputData for voice.
        Generate the message for an Notification.
        Return VoiceOutputData for sending.
        """
    
        spoken_date = texthelper.date_to_text(self.date.weekday() + 1, \
            self.date.day, self.date.month, self.date.hour, self.date.minute)

        data = VoiceOutputData()
        
        contents = {'date': unicode(spoken_date["date"]),
                    'time' : unicode(spoken_date["time"]),
                    'hospital': self.hospital.name}
                    
        data.data = self.reminder_text(contents, False)
        data.phone_number = self.recipient.phone_number

        return data
Example #2
0
    def test_date_to_text(self):
        date = texthelper.date_to_text(3, 18, 3, 11, 40)

        self.assertEquals(date["date"], "Wednesday, eighteenth of March")
        self.assertEquals(date["time"], "eleven forty")