Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test_plus/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,13 @@ def __init__(self, *args, **kwargs):


class APITestCase(TestCase):
def __init__(self, *args, **kwargs):
self.client_class = get_api_client()
super(APITestCase, self).__init__(*args, **kwargs)


def setUp(self):
super(APITestCase, self).setUp()
api_client_class = get_api_client()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting that api_client_class is a better name than we landed on.

self.client = api_client_class()

# Note this class inherits from TestCase defined above.
class CBVTestCase(TestCase):
"""
Expand Down
4 changes: 4 additions & 0 deletions test_project/test_app/tests/test_unittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,10 @@ def test_get_with_non_primitive_data_type(self):
assert response["content-type"] == "application/json"
self.response_200()

def test_force_authenticate(self):
u1 = self.make_user()
self.client.force_authenticate(u1)


# pytest tests
def test_tp_loads(tp):
Expand Down