'We check against parameters multiple times in case things change
after more parameters are added.'

def test_collect_parameters(self):

    self.assertEqual(collect_parameters(), [])
    parameters = collect_parameters(uri_query=self.uri_query)
    correct_parameters = [(u'b5', u'=%3D'), (u'a3', u'a'), (u'c@', u''), (u'a2', u'r    b'), (u'c2', u''), (u'a3', u'2    q')]
    self.assertEqual(sorted(parameters), sorted(correct_parameters))
    headers = {u'Authorization': self.authorization_header}
    parameters = collect_parameters(uri_query=self.uri_query, headers=headers)
    parameters_with_realm = collect_parameters(uri_query=self.uri_query, headers=headers, with_realm=True)
    correct_parameters += [(u'oauth_nonce', u'7d8f3e4a'), (u'oauth_timestamp', u'137131201'), (u'oauth_consumer_key', u'9djdj82h48djs9d2'), (u'oauth_signature_method', u'HMAC-SHA1'), (u'oauth_token', u'kkk9d7dh3k39sjv7')]
    correct_parameters_with_realm = (correct_parameters + [(u'realm', u'Example')])
    self.assertEqual(sorted(parameters), sorted(correct_parameters))
    self.assertEqual(sorted(parameters_with_realm), sorted(correct_parameters_with_realm))
    parameters = collect_parameters(uri_query=self.uri_query, body=self.body, headers=headers)
    correct_parameters += [(u'content', u'This    is    being    the    body    of    things')]
    self.assertEqual(sorted(parameters), sorted(correct_parameters))
