Example #1
0
File: post.py Project: 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)
Example #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)
Example #3
0
File: post.py Project: 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)
Example #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)