only validated companies showing in views
This commit is contained in:
@@ -7,7 +7,7 @@ from django.test import TestCase
|
||||
from rest_framework.test import APITestCase
|
||||
from rest_framework import status
|
||||
|
||||
from companies.factories import CompanyFactory
|
||||
from companies.factories import ValidatedCompanyFactory
|
||||
from companies.models import Company
|
||||
|
||||
from core.factories import CustomUserFactory
|
||||
@@ -23,7 +23,7 @@ class CompanyViewSetTest(APITestCase):
|
||||
"""Tests setup
|
||||
"""
|
||||
self.endpoint = '/api/v1/companies/'
|
||||
self.factory = CompanyFactory
|
||||
self.factory = ValidatedCompanyFactory
|
||||
self.model = Company
|
||||
# create user
|
||||
self.password = ''.join(random.choices(string.ascii_uppercase, k = 10))
|
||||
@@ -302,7 +302,7 @@ class MyCompanyViewTest(APITestCase):
|
||||
"""Tests setup
|
||||
"""
|
||||
self.endpoint = '/api/v1/my_company/'
|
||||
self.factory = CompanyFactory
|
||||
self.factory = ValidatedCompanyFactory
|
||||
self.model = Company
|
||||
# create user
|
||||
self.email = f"user@mail.com"
|
||||
@@ -313,10 +313,7 @@ class MyCompanyViewTest(APITestCase):
|
||||
|
||||
def test_auth_user_gets_data(self):
|
||||
# create instance
|
||||
user_instances = [
|
||||
self.factory(creator=self.user),
|
||||
self.factory(creator=self.user),
|
||||
]
|
||||
user_instances = [self.factory(creator=self.user) for i in range(5)]
|
||||
|
||||
# Authenticate
|
||||
token = get_tokens_for_user(self.user)
|
||||
@@ -365,7 +362,7 @@ class RandomCompanySampleTest(APITestCase):
|
||||
"""Tests setup
|
||||
"""
|
||||
self.endpoint = '/api/v1/companies/sample/'
|
||||
self.factory = CompanyFactory
|
||||
self.factory = ValidatedCompanyFactory
|
||||
self.model = Company
|
||||
# create user
|
||||
self.email = f"user@mail.com"
|
||||
|
||||
Reference in New Issue
Block a user