def get_data_for_bluetooth(self): """ Prepare OutputData for voice. Generate the message for a Notification. Return BluetoothOutputData for sending. """ logger.info("starting get_data_for_bluetooth() in Notification") data = BluetoothOutputData() data.bluetooth_mac_address = self.bluetooth_mac_address data.server_address = self.bluetooth_server_address logger.info("Sending to Bluetooth Mac Address " + data.bluetooth_mac_address + " and Bluetooth Server " + data.server_address) try: self.hospital except Hospital.DoesNotExist: self.hospital = Hospital.get_current_hospital() content = self.reminder_text() uid = vcal.get_uid() data.data = vcal.create_vcal_string(self.date, self.hospital, content, uid) logger.info("Created vCal with uid %s" % str(uid)) logger.debug("Created vCal: " + data.data) return data
def test_get_uid(self): vcal.datetime = self.FakeDatetime() result = vcal.get_uid() string = self.FakeDatetime().now().strftime("%Y%m%dT%H%M%S") string += "@" + settings.VCAL_UID_SLUG self.assertEquals(result, string) vcal.datetime = datetime