From 92d4c251db0d376b5b05216ac7abf3a3d54209e7 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Wed, 29 Nov 2017 12:42:39 +0100 Subject: [PATCH] unit test for flying team to string method --- smash/web/models/flying_team.py | 21 --------------------- smash/web/tests/models/test_flying_team.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 21 deletions(-) create mode 100644 smash/web/tests/models/test_flying_team.py diff --git a/smash/web/models/flying_team.py b/smash/web/models/flying_team.py index e44dc127..45b98217 100644 --- a/smash/web/models/flying_team.py +++ b/smash/web/models/flying_team.py @@ -6,27 +6,6 @@ class FlyingTeam(models.Model): class Meta: app_label = 'web' - # doctor = models.ForeignKey(Worker, related_name='FlyingTeamDoctor', - # verbose_name='Doctor' - # ) - # nurse = models.ForeignKey(Worker, related_name='FlyingTeamNurse', - # verbose_name='Nurse' - # ) - # psychologist = models.ForeignKey(Worker, related_name='FlyingTeamPsychologist', - # verbose_name='Psychologist' - # ) - # datetime_called = models.DateTimeField( - # verbose_name='Created on' - # ) - # datetime_until = models.DateTimeField( - # verbose_name='Disbanded on' - # ) - # - # def __str__(self): - # return "%s %s %s" % (self.doctor.last_name, self.nurse.last_name, self.psychologist.last_name) - # - # def __unicode__(self): - # return "%s %s %s" % (self.doctor.last_name, self.nurse.last_name, self.psychologist.last_name) place = models.CharField(max_length=255, verbose_name='Place') def __str__(self): diff --git a/smash/web/tests/models/test_flying_team.py b/smash/web/tests/models/test_flying_team.py new file mode 100644 index 00000000..b1983ee8 --- /dev/null +++ b/smash/web/tests/models/test_flying_team.py @@ -0,0 +1,14 @@ +import logging + +from django.test import TestCase + +from web.models import FlyingTeam + +logger = logging.getLogger(__name__) + + +class FlyingTeamTests(TestCase): + def test_image_img(self): + flying_team = FlyingTeam(place="xxx") + + self.assertTrue("x" in str(flying_team)) -- GitLab