Example #1
0
 def test_get_data_for_bluetooth(self):
     #create new notification without saving
     notification = Notification()        
     notification.date = datetime(2010, 4, 4)
     notification.notification_type = NotificationType.objects.get(pk = 1)
     notification.bluetooth_mac_address = "00AA11BB22"
     notification.bluetooth_server_address = "123.456.789.1"
             
     output_data = notification.get_data_for_bluetooth()
     
     self.assertEquals(type(output_data), BluetoothOutputData)
     self.assertEquals(output_data.bluetooth_mac_address, "00AA11BB22")
     self.assertEquals(output_data.server_address, \
                       '123.456.789.1')
     self.assertEquals(type(output_data.data).__name__, "unicode")