Example #1
0
 def test_messaging_user_not_following(self):
     form = ComposeForm(data={
         'recipient': self.user_two,
         'subject': 'Foo',
         'body': 'Bar',
     }, sender=self.user)
     self.assertTrue(form.is_bound)
     self.assertFalse(form.is_valid())
Example #2
0
 def test_messaging_user(self):
     print "From test: %s" % (self.user.user,)
     print "From test: %s" % (self.user_two.user,)
     form = ComposeForm(data={
         'recipient': self.user_two,
         'subject': 'Foo',
         'body': 'Bar',
     }, sender=self.user)
     self.assertTrue(form.is_bound)
     self.assertTrue(form.is_valid())
Example #3
0
 def test_messaging_user_following(self):
     print "From test: %s" % (self.user.user,)
     print "From test: %s" % (self.user_two.user,)
     Relationship(source=self.user_two, target_user=self.user).save()
     form = ComposeForm(data={
         'recipient': self.user_two,
         'subject': 'Foo',
         'body': 'Bar',
     }, sender=self.user)
     self.assertTrue(form.is_bound)
     self.assertTrue(form.is_valid())
Example #4
0
 def test_messaging_user_following(self):
     print "From test: %s" % (self.user.user, )
     print "From test: %s" % (self.user_two.user, )
     Relationship(source=self.user_two, target_user=self.user).save()
     form = ComposeForm(data={
         'recipient': self.user_two,
         'subject': 'Foo',
         'body': 'Bar',
     },
                        sender=self.user)
     self.assertTrue(form.is_bound)
     self.assertTrue(form.is_valid())
Example #5
0
 def test_messaging_user_following_project(self):
     project = Project(
         name='test project',
         short_description='abcd',
         long_description='edfgh',
         created_by=self.user)
     project.save()
     Relationship(source=self.user_two, target_project=project).save()
     form = ComposeForm(data={
         'recipient': self.user_two,
         'subject': 'Foo',
         'body': 'Bar',
     }, sender=self.user)
     self.assertTrue(form.is_bound)
     self.assertTrue(form.is_valid())
Example #6
0
 def test_messaging_user_following_project(self):
     project = Project(name='test project',
                       short_description='abcd',
                       long_description='edfgh',
                       created_by=self.user)
     project.save()
     Relationship(source=self.user_two, target_project=project).save()
     form = ComposeForm(data={
         'recipient': self.user_two,
         'subject': 'Foo',
         'body': 'Bar',
     },
                        sender=self.user)
     self.assertTrue(form.is_bound)
     self.assertTrue(form.is_valid())
Example #7
0
 def test_messaging_user(self):
     print "From test: %s" % (self.user.user,)
     print "From test: %s" % (self.user_two.user,)
     form = ComposeForm(data={"recipient": self.user_two, "subject": "Foo", "body": "Bar"}, sender=self.user)
     self.assertTrue(form.is_bound)
     self.assertTrue(form.is_valid())