# Path: test_accounts/models.py
# class Account(OrganizationBase):
#     monthly_subscription = models.IntegerField(default=1000)
# 
# Path: test_accounts/models.py
# class AccountUser(OrganizationUserBase):
#     user_type = models.CharField(max_length=1, default="")
# 
# Path: tests/utils.py
# def request_factory_login(factory, user=None, method="request", **kwargs):
#     """Based on this gist: https://gist.github.com/964472"""
#     # engine = import_module(settings.SESSION_ENGINE)
#     request = getattr(factory, method)(**kwargs)
#     # request.session = engine.SessionStore()
#     # request.session[SESSION_KEY] = user.pk
#     request.user = user or AnonymousUser()
#     return request


from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from django.urls import reverse
from organizations.models import Organization
from organizations.models import OrganizationUser
from organizations.utils import create_organization
from organizations.views import base
from test_accounts.models import Account
from test_accounts.models import AccountUser
from tests.utils import request_factory_login
import pytest




@pytest.fixture
def account_user():
    yield User.objects.create(username="AccountUser", email="akjdkj@kjdk.com")


@pytest.fixture
def account_account(account_user):

# Path: test_accounts/models.py
# class Account(OrganizationBase):
#     monthly_subscription = models.IntegerField(default=1000)
# 
# Path: test_accounts/models.py
# class AccountUser(OrganizationUserBase):
#     user_type = models.CharField(max_length=1, default="")
# 
# Path: tests/utils.py
# def request_factory_login(factory, user=None, method="request", **kwargs):
#     """Based on this gist: https://gist.github.com/964472"""
#     # engine = import_module(settings.SESSION_ENGINE)
#     request = getattr(factory, method)(**kwargs)
#     # request.session = engine.SessionStore()
#     # request.session[SESSION_KEY] = user.pk
#     request.user = user or AnonymousUser()
#     return request


# Path: tests/test_views.py
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from django.urls import reverse
from organizations.models import Organization
from organizations.models import OrganizationUser
from organizations.utils import create_organization
from organizations.views import base
from test_accounts.models import Account
from test_accounts.models import AccountUser
from tests.utils import request_factory_login
import pytest





@pytest.fixture
def account_user():
    yield User.objects.create(username="AccountUser", email="akjdkj@kjdk.com")


@pytest.fixture
def account_account(account_user):

    yield create_organization(account_user, "Acme", org_model=Account)