Esempio n. 1
0
File: post.py Progetto: 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)
Esempio 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)
Esempio n. 3
0
File: post.py Progetto: 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)
Esempio 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)