Ejemplo n.º 1
0
 def setUp(self):
     self.staff_user = StaffUserFactory()
     self.simple_user = UserFactory()
     MembersModel.objects.create(user=self.staff_user,
                                 project=self.project1,
                                 joined_date=today())
     MembersModel.objects.create(user=self.simple_user,
                                 project=self.project1,
                                 joined_date=today())
     MembersModel.objects.create(user=self.simple_user,
                                 project=self.project2,
                                 joined_date=today())
Ejemplo n.º 2
0
 def is_assessment(self) -> bool:
     from ssm.assessments.models import Assessment
     assessment_notificaiton = self.assessment_notification if self.assessment_notification else None
     return Assessment.objects.filter(
         user=self,
         end_date=today()) and assessment_notificaiton != today()
Ejemplo n.º 3
0
 def is_birthday(self) -> bool:
     date_of_birth = self.date_of_birth if self.date_of_birth else None
     birthday_notification = self.birthday_notification if self.birthday_notification else None
     return date_of_birth == today() and birthday_notification != today()
Ejemplo n.º 4
0
 def test_is_birthday__false__already_notified(self):
     self.user.date_of_birth = today()
     self.user.birthday_notification = today()
     assert not self.user.is_birthday()
Ejemplo n.º 5
0
 def test_is_birthday__true(self):
     self.user.date_of_birth = today()
     assert self.user.is_birthday()