'Tests the creation of a document with no a map related'

def test_create_document_with_rel(self):

    f = SimpleUploadedFile('test_img_file.gif', self.imgfile.read(), 'image/gif')
    superuser = get_user_model().objects.get(pk=2)
    c = Document.objects.create(doc_file=f, owner=superuser, title='theimg')
    m = Map.objects.all()[0]
    ctype = ContentType.objects.get_for_model(m)
    l = DocumentResourceLink.objects.create(document_id=c.id, content_type=ctype, object_id=m.id)
    self.assertEquals(Document.objects.get(pk=c.id).title, 'theimg')
    self.assertEquals(DocumentResourceLink.objects.get(pk=l.id).object_id, m.id)
