예제 #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
예제 #2
0
파일: test_views.py 프로젝트: tekd/noi2
 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
예제 #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
예제 #4
0
파일: test_views.py 프로젝트: tekd/noi2
 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
예제 #5
0
파일: test_views.py 프로젝트: toolness/noi2
 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
예제 #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
예제 #7
0
파일: test_views.py 프로젝트: tekd/noi2
 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