Make TestAcceptSubscription work..
..by using Django default test client instead of the one from `rest_framework`.
This commit is contained in:
parent
fbb58b1737
commit
7ee6ac7691
@ -1,17 +1,15 @@
|
||||
import json
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.test import TestCase
|
||||
from django.urls import reverse
|
||||
from rest_framework.test import APIClient, APIRequestFactory, APITestCase
|
||||
from django.test import Client, TestCase
|
||||
|
||||
|
||||
class TestAcceptSubscription(TestCase):
|
||||
def setUp(self):
|
||||
self.factory = APIRequestFactory()
|
||||
self.client = APIClient()
|
||||
self.user = get_user_model().objects.create_user(username='john', email='jlennon@beatles.com', password='glass onion')
|
||||
self.client.force_authenticate(self.user)
|
||||
self.client = Client()
|
||||
self.user = get_user_model().objects.create(username='john', email='jlennon@beatles.com', password='glass onion')
|
||||
self.client.force_login(self.user)
|
||||
|
||||
def tearDown(self):
|
||||
self.user.delete()
|
||||
|
Reference in New Issue
Block a user