'The `next` key needs to handle already having an anchor. Refs #13411.'

def testCommentNextWithQueryStringAndAnchor(self):

    a = Article.objects.get(pk=1)
    data = self.getValidData(a)
    data['next'] = '/somewhere/else/?foo=bar#baz'
    data['comment'] = 'This    is    another    comment'
    response = self.client.post('/post/', data)
    location = response['Location']
    match = re.search('^http://testserver/somewhere/else/\\?foo=bar&c=\\d+#baz$', location)
    self.assertTrue((match != None), ('Unexpected    redirect    location:    %s' % location))
    a = Article.objects.get(pk=1)
    data = self.getValidData(a)
    data['next'] = '/somewhere/else/#baz'
    data['comment'] = 'This    is    another    comment'
    response = self.client.post('/post/', data)
    location = response['Location']
    match = re.search('^http://testserver/somewhere/else/\\?c=\\d+#baz$', location)
    self.assertTrue((match != None), ('Unexpected    redirect    location:    %s' % location))
