コード例 #1
0
 def test_src(self):
     a = AttachmentFactory()
     # not really implemented yet
     self.assertEqual(a.src(), "")
コード例 #2
0
 def test_image(self):
     a = AttachmentFactory(type='jpg')
     self.assertTrue(a.image())
     a = AttachmentFactory(type='png')
     self.assertTrue(a.image())
     a = AttachmentFactory(type='gif')
     self.assertTrue(a.image())
     a = AttachmentFactory(type='doc')
     self.assertFalse(a.image())
コード例 #3
0
 def test_get_absolute_url(self):
     a = AttachmentFactory()
     self.assertEqual(a.get_absolute_url(), "/attachment/%d/" % a.id)
コード例 #4
0
 def test_attachments(self):
     a = AttachmentFactory()
     self.assertEqual(a.item.milestone.project.attachments().count(), 1)