Exemple #1
0
 def _prepare_letters(self, letter_data):
     letters = []
     for created_on, created_by in letter_data:
         obj = LetterFactory(created_by=created_by)
         obj.created_on = make_aware(created_on)
         obj.save()
         letters.append(obj)
     return letters
Exemple #2
0
 def _prepare_letters(self, letter_data):
     letters = []
     for created_on, created_by in letter_data:
         obj = LetterFactory(created_by=created_by)
         obj.created_on = make_aware(created_on)
         obj.save()
         letters.append(obj)
     return letters
Exemple #3
0
 def _prepare_letters(self, letter_data, case):
     letters = []
     for accept, created_by, status in letter_data:
         obj = LetterFactory(created_by=created_by,
                             case=case,
                             status=status)
         obj.accept = make_aware(accept)
         obj.save()
         letters.append(obj)
     return letters
Exemple #4
0
 def _prepare_letters(self, letter_data, case):
     letters = []
     for accept, created_by, status in letter_data:
         obj = LetterFactory(created_by=created_by,
                             case=case,
                             status=status)
         obj.accept = make_aware(accept)
         obj.save()
         letters.append(obj)
     return letters
Exemple #5
0
 def test_lr_new_client_letter_update(self):
     l = LetterFactory(case=self.case,
                       created_by__is_staff=False)
     self.assertEqual(Letter.objects.case(self.case).last_received(), l)
     new = LetterFactory(case=self.case,
                         created_by__is_staff=False)
     self.assertEqual(Letter.objects.case(self.case).last_received(), new)
     t = self.now - timedelta(days=10)
     old = LetterFactory(created_on=t,
                         case=self.case,
                         created_by__is_staff=False)
     old.created_on = t
     old.save()
     self.assertEqual(Letter.objects.case(self.case).last_received(), new)