Exemplo n.º 1
0
Arquivo: post.py Projeto: ptpt/taoblog
 def test_content(self):
     post = Post(title='hello world',
                 text='world',
                 slug='hello-world',
                 author_id=1)
     self.assertEqual(post.content, '<p>%s</p>\n' % post.text)
     post.text = 'new world'
     self.assertEqual(post.content, '<p>%s</p>\n' % post.text)
Exemplo n.º 2
0
 def test_date(self):
     post = Post(title='hello world', text='world',
                 slug='hello-world', author_id=1)
     self.assertIsNone(post.created_at)
     self.assertIsNone(post.updated_at)
     self.session.add(post)
     self.session.commit()
     self.assertIsNotNone(post.created_at)
     self.assertIsNone(post.updated_at)
     post.text = 'new world'
     self.session.commit()
     self.assertIsNotNone(post.updated_at)
Exemplo n.º 3
0
Arquivo: post.py Projeto: ptpt/taoblog
 def test_date(self):
     post = Post(title='hello world',
                 text='world',
                 slug='hello-world',
                 author_id=1)
     self.assertIsNone(post.created_at)
     self.assertIsNone(post.updated_at)
     self.session.add(post)
     self.session.commit()
     self.assertIsNotNone(post.created_at)
     self.assertIsNone(post.updated_at)
     post.text = 'new world'
     self.session.commit()
     self.assertIsNotNone(post.updated_at)
Exemplo n.º 4
0
 def test_content(self):
     post = Post(title='hello world', text='world',
                 slug='hello-world', author_id=1)
     self.assertEqual(post.content, '<p>%s</p>\n' % post.text)
     post.text = 'new world'
     self.assertEqual(post.content, '<p>%s</p>\n' % post.text)