# 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
def account_account(account_user):
    yield create_organization(account_user, "Acme", org_model=Account)


@pytest.fixture
def org_organization(account_user):
    yield create_organization(account_user, "Acme", org_model=Organization)


@pytest.fixture
def extra_org_user(org_organization):
    new_user = User.objects.create(username="NotYou", email="not@you.com")
    org_organization.add_user(new_user)
    yield new_user


@pytest.fixture
def invitee_user():
    yield User.objects.create_user(
        "newmember", email="jd@123.com", password="password123"
    )


class TestUserReminderView:
    @pytest.mark.parametrize("method", [("get"), ("post")])
    def test_bad_request_for_active_user(
        self, rf, account_account, account_user, invitee_user, method
    ):
        class OrgUserReminderView(base.BaseOrganizationUserRemind):
            org_model = Account

# 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

def account_account(account_user):
    yield create_organization(account_user, "Acme", org_model=Account)


@pytest.fixture
def org_organization(account_user):
    yield create_organization(account_user, "Acme", org_model=Organization)


@pytest.fixture
def extra_org_user(org_organization):
    new_user = User.objects.create(username="NotYou", email="not@you.com")
    org_organization.add_user(new_user)
    yield new_user


@pytest.fixture
def invitee_user():
    yield User.objects.create_user(
        "newmember", email="jd@123.com", password="password123"
    )


class TestUserReminderView:
    @pytest.mark.parametrize("method", [("get"), ("post")])
    def test_bad_request_for_active_user(
        self, rf, account_account, account_user, invitee_user, method
    ):
        class OrgUserReminderView(base.BaseOrganizationUserRemind):
            org_model = Account

            user_model = AccountUser