Esempio n. 1
0
 def test_save__collects_recipients__reply_copies_from_parent(self):
     form = ContentForm(
         data={
             "text": "foobar",
         },
         user=self.user,
         is_reply=True,
     )
     form.full_clean()
     self.assertTrue(form.is_valid())
     content = form.save(parent=self.limited_content)
     self.assertEqual(
         set(content.limited_visibilities.all()),
         {self.profile, self.profile2},
     )
Esempio n. 2
0
 def test_save__collects_recipients__reply_copies_from_parent(self):
     form = ContentForm(
         data={
             "text": "foobar",
         },
         user=self.user,
         is_reply=True,
     )
     form.full_clean()
     self.assertTrue(form.is_valid())
     content = form.save(parent=self.limited_content)
     self.assertEqual(
         set(content.limited_visibilities.all()),
         {self.profile, self.profile2},
     )
Esempio n. 3
0
 def test_save__collects_recipients(self):
     form = ContentForm(
         data={
             "text": "foobar",
             "visibility": Visibility.LIMITED,
             "recipients": "[email protected],[email protected]"
         },
         user=self.user,
     )
     form.full_clean()
     self.assertTrue(form.is_valid())
     content = form.save()
     self.assertEqual(
         set(content.limited_visibilities.all()),
         {self.profile, self.profile2},
     )
Esempio n. 4
0
 def test_save__collects_recipients(self):
     form = ContentForm(
         data={
             "text": "foobar",
             "visibility": Visibility.LIMITED,
             "recipients": "[email protected],[email protected]"
         },
         user=self.user,
     )
     form.full_clean()
     self.assertTrue(form.is_valid())
     content = form.save()
     self.assertEqual(
         set(content.limited_visibilities.all()),
         {self.profile, self.profile2},
     )