'Ensure the response returns an Retry-After field with status and next attributes
set properly.'

def ensure_response_header_contains_proper_throttle_field(self, view, expected_headers):

    request = self.factory.get(u'/')
    for (timer, expect) in expected_headers:
        self.set_throttle_timer(view, timer)
        response = view.as_view()(request)
        if (expect is not None):
            assert (response[u'Retry-After'] == expect)
        else:
            assert (not (u'Retry-After' in response))
