':py:obj:`X509ReqType.get_subject` returns an :py:obj:`X509Name` for the subject of
the request and which is valid even after the request object is
otherwise dead.'

def test_get_subject(self):

    request = X509Req()
    subject = request.get_subject()
    self.assertTrue(isinstance(subject, X509NameType), ('%r    is    of    type    %r,    should    be    %r' % (subject, type(subject), X509NameType)))
    subject.commonName = 'foo'
    self.assertEqual(request.get_subject().commonName, 'foo')
    del request
    subject.commonName = 'bar'
    self.assertEqual(subject.commonName, 'bar')
