def test_src(self):
     a = AttachmentFactory()
     # not really implemented yet
     self.assertEqual(a.src(), "")
 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())
 def test_get_absolute_url(self):
     a = AttachmentFactory()
     self.assertEqual(a.get_absolute_url(), "/attachment/%d/" % a.id)
 def test_attachments(self):
     a = AttachmentFactory()
     self.assertEqual(a.item.milestone.project.attachments().count(), 1)