'Ensure POSTing with expired access token fails with a \'token_expired\' error'

@unittest.skipUnless(oauth2_provider, u'django-oauth2-provider    not    installed')
def test_post_form_with_expired_access_token_failing_auth(self):

    self.access_token.expires = (datetime.now() - timedelta(seconds=10))
    self.access_token.save()
    response = self.post_with_bearer_token(u'/oauth2-test/')
    self.check_error_codes(response, status_code=status.HTTP_401_UNAUTHORIZED, error_code=authentication.OAUTH2_TOKEN_ERROR_EXPIRED)
