Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am deepakkabbur on github.
  • I am deepakkabbur (https://keybase.io/deepakkabbur) on keybase.
  • I have a public key ASBPigMi0KP9oh7ikvwWE-722YCxkiHheu0hzIzgFxy93go

To claim this, I am signing this object:

@deepakkabbur
deepakkabbur / ApiTestClient.py
Last active May 10, 2020 13:55
Outh2 Authentication in unit tests using Django Rest Framework and Django Oauth Toolkit
from rest_framework.test import APIClient
from rest_framework.test import APITestCase
from accounts.models import User
class ApiUserTestClient(APITestCase):
"""
Helper base class for API test
"""
client = APIClient()
@deepakkabbur
deepakkabbur / py
Created April 18, 2019 14:18
Base Request Python
import requests
class BaseRequest(object):
"""
Base class for Request Creation.
Session()
The Session object allows you to persist certain parameters across requests.
So if you’re making several requests to the same host,
the underlying TCP connection will be reused, which can result in a