forked from ungleich-public/dynamicweb
fix hosting tests
This commit is contained in:
parent
8caca66b66
commit
4bcb3f2e04
5 changed files with 159 additions and 260 deletions
|
|
@ -15,6 +15,7 @@ from datacenterlight.models import StripePlan
|
|||
from membership.models import StripeCustomer
|
||||
from utils.stripe_utils import StripeUtils
|
||||
from .tasks import save_ssh_key
|
||||
from factories import CustomUserFactory
|
||||
|
||||
|
||||
class BaseTestCase(TestCase):
|
||||
|
|
@ -304,3 +305,13 @@ class SaveSSHKeyTestCase(TestCase):
|
|||
break
|
||||
self.assertIsNotNone(save_ssh_key, "save_ssh_key_result is None")
|
||||
self.assertTrue(save_ssh_key_result, "save_ssh_key_result is False")
|
||||
|
||||
|
||||
def create_customer_client(customer=None):
|
||||
"""Create a logged-in test client without invoking the login backend."""
|
||||
customer = customer or CustomUserFactory.create()
|
||||
|
||||
client = Client()
|
||||
client.force_login(customer)
|
||||
|
||||
return customer, client
|
||||
Loading…
Add table
Add a link
Reference in a new issue