Exemple #1
0
 def test_posting_activity_requires_login(self):
     res = self.client.post('/activity', data=dict(
         message=u"hello there"
     ), follow_redirects=True)
     self.assert200(res)
     self.assertEqual(SharedMessageEvent.query_in_deployment().count(), 0)
     assert 'You must log in to post a message' in res.data
Exemple #2
0
 def test_posting_activity_requires_login(self):
     res = self.client.post('/activity',
                            data=dict(message=u"hello there"),
                            follow_redirects=True)
     self.assert200(res)
     self.assertEqual(SharedMessageEvent.query_in_deployment().count(), 0)
     assert 'You must log in to post a message' in res.data
Exemple #3
0
 def test_posting_activity_requires_full_name(self):
     self.login(first_name=u'', last_name=u'')
     res = self.client.post('/activity', data=dict(
         message=u"hello there"
     ), follow_redirects=True)
     self.assert200(res)
     self.assertEqual(SharedMessageEvent.query_in_deployment().count(), 0)
     assert 'We need your name before you can post' in res.data
Exemple #4
0
 def test_posting_activity_requires_full_name(self):
     self.login(first_name=u'', last_name=u'')
     res = self.client.post('/activity',
                            data=dict(message=u"hello there"),
                            follow_redirects=True)
     self.assert200(res)
     self.assertEqual(SharedMessageEvent.query_in_deployment().count(), 0)
     assert 'We need your name before you can post' in res.data
Exemple #5
0
 def test_posting_activity_works(self):
     self.login()
     user = User.query_in_deployment().filter(User.email == "*****@*****.**").one()
     user.first_name = "John"
     user.last_name = "Doe"
     res = self.client.post("/activity", data=dict(message=u"hello there"), follow_redirects=True)
     self.assert200(res)
     self.assertEqual(SharedMessageEvent.query_in_deployment().count(), 1)
     assert "Message posted" in res.data
     assert "hello there" in res.data
Exemple #6
0
 def test_posting_activity_works(self):
     self.login()
     user = User.query_in_deployment()\
              .filter(User.email == '*****@*****.**').one()
     user.first_name = 'John'
     user.last_name = 'Doe'
     res = self.client.post('/activity', data=dict(
         message=u"hello there"
     ), follow_redirects=True)
     self.assert200(res)
     self.assertEqual(SharedMessageEvent.query_in_deployment().count(), 1)
     assert 'Message posted' in res.data
     assert 'hello there' in res.data
Exemple #7
0
 def test_posting_activity_works(self):
     self.login()
     user = User.query_in_deployment()\
              .filter(User.email == '*****@*****.**').one()
     user.first_name = 'John'
     user.last_name = 'Doe'
     res = self.client.post('/activity',
                            data=dict(message=u"hello there"),
                            follow_redirects=True)
     self.assert200(res)
     self.assertEqual(SharedMessageEvent.query_in_deployment().count(), 1)
     assert 'Message posted' in res.data
     assert 'hello there' in res.data