# Path: sendinel/backend/models.py
# class WayOfCommunication(models.Model):
#     """
#     Represent a possible Way of Communication like SMS
#     """
#     
#     name = models.CharField(max_length = 255, blank = False, null = False)
#     verbose_name = models.CharField(max_length = 255)
#     enabled = models.BooleanField()
#     can_send_immediately = models.BooleanField()
#     
#     def __unicode__(self):
#         return self.verbose_name
# 
# def get_enabled_wocs():
#     """
#     Return all Ways of Communication that are enabled
#     """
#     return WayOfCommunication.objects.all().filter(enabled = True)
# 
# def get_immediate_wocs():
#     """
#     Return all Ways of Communication that are enabled
#     and can be send immediately
#     """
#     return WayOfCommunication.objects.all().filter(enabled = True, \
#                                                    can_send_immediately = True)                                                    
# 
# def get_woc(woc_name):
#     """
#     Return the WayOfCommunication-Object where the name equals the 
#     given woc_name
#     """
#     return WayOfCommunication.objects.get(name = woc_name)        


from django.test import TestCase
from sendinel.backend.models import WayOfCommunication, \
                                    get_enabled_wocs, \
                                    get_immediate_wocs, \
                                    get_woc



class WayOfCommunicationTest(TestCase):

    fixtures = ["backend_test"]

    def setUp(self):
        self.woc_sms = WayOfCommunication.objects.get(name = "sms")        
        self.woc_voice = WayOfCommunication.objects.get(name = "voice")

# Path: sendinel/backend/models.py
# class WayOfCommunication(models.Model):
#     """
#     Represent a possible Way of Communication like SMS
#     """
#     
#     name = models.CharField(max_length = 255, blank = False, null = False)
#     verbose_name = models.CharField(max_length = 255)
#     enabled = models.BooleanField()
#     can_send_immediately = models.BooleanField()
#     
#     def __unicode__(self):
#         return self.verbose_name
# 
# def get_enabled_wocs():
#     """
#     Return all Ways of Communication that are enabled
#     """
#     return WayOfCommunication.objects.all().filter(enabled = True)
# 
# def get_immediate_wocs():
#     """
#     Return all Ways of Communication that are enabled
#     and can be send immediately
#     """
#     return WayOfCommunication.objects.all().filter(enabled = True, \
#                                                    can_send_immediately = True)                                                    
# 
# def get_woc(woc_name):
#     """
#     Return the WayOfCommunication-Object where the name equals the 
#     given woc_name
#     """
#     return WayOfCommunication.objects.get(name = woc_name)        


# Path: sendinel/backend/tests/way_of_communication_test.py
from django.test import TestCase
from sendinel.backend.models import WayOfCommunication, \
                                    get_enabled_wocs, \
                                    get_immediate_wocs, \
                                    get_woc




class WayOfCommunicationTest(TestCase):

    fixtures = ["backend_test"]

    def setUp(self):
        self.woc_sms = WayOfCommunication.objects.get(name = "sms")        
        self.woc_voice = WayOfCommunication.objects.get(name = "voice")

        self.woc_bluetooth = WayOfCommunication.objects.get(name = "bluetooth")