Exemple #1
0
    def test_medicalissue_unicode(self):
        '''This tests the unicode representation of a :class:`~mousedb.veterinary.models.MedicalIssue`.'''

        test_medical_issue = MedicalIssue(animal= Animal.objects.get(pk=1),
        	condition = MedicalCondition.objects.get(pk=1)) 
        test_medical_issue.save()
        self.assertEqual(test_medical_issue.__unicode__(), "Fixture Strain (1) - Test Condition") 
Exemple #2
0
    def test_create_new_medicalissue_minimum(self):
        '''This test creates a :class:`~mousedb.veterinary.models.MedicalIssue` with the required information only.'''

        test_medical_issue = MedicalIssue(animal= Animal.objects.get(pk=1),
        	condition = MedicalCondition.objects.get(pk=1)) 
        test_medical_issue.save()
        self.assertEqual(test_medical_issue.pk, 1) #presumes one model loaded in fixture data
Exemple #3
0
    def test_medicalissue_absolute_url(self):
        '''This tests the absolute_url generation of a :class:`~mousedb.veterinary.models.MedicalIssue`.'''

        test_medical_issue = MedicalIssue(animal= Animal.objects.get(pk=1),
        	condition = MedicalCondition.objects.get(pk=1)) 
        test_medical_issue.save()
        self.assertEqual(test_medical_issue.get_absolute_url(), "/veterinary/medical-issue/1") #where the url should be 
Exemple #4
0
    def test_create_new_medicalissue_all(self):
        '''This test creates a :class:`~mousedb.veterinary.models.MedicalIssue` with all information entered.'''

        test_medical_issue = MedicalIssue(animal= Animal.objects.get(pk=1),
        	condition = MedicalCondition.objects.get(pk=1),
        	treatment = MedicalTreatment.objects.get(pk=1),
        	diagnosis = datetime.date.today(),
        	treatment_start = datetime.date.today(),
        	treatment_end = datetime.date.today(),) 
        test_medical_issue.save() 
        self.assertEqual(test_medical_issue.pk, 1) #presumes one model loaded in fixture data