# 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

        request = getattr(rf, method)("/", user=account_user)
        kwargs = {"organization_pk": account_account.pk, "user_pk": account_user.pk}
        response = OrgUserReminderView.as_view()(request, **kwargs)
        assert response.status_code == 410

    def test_organization_user_reminder(
        self, rf, account_account, account_user, invitee_user
    ):
        class OrgUserReminderView(base.BaseOrganizationUserRemind):
            org_model = Account
            user_model = AccountUser

        invitee_user.is_active = False
        invitee_user.save()
        account_account.add_user(invitee_user)
        request = rf.get("/", user=account_user)
        kwargs = {"organization_pk": account_account.pk, "user_pk": invitee_user.pk}
        response = OrgUserReminderView.as_view()(request, **kwargs)
        assert response.status_code == 200

        request = rf.post("/")
        request.user = account_user
        response = OrgUserReminderView.as_view()(request, **kwargs)
        assert response.status_code == 302


class TestSignupView:
    def test_anon_user_can_access_signup_view(self, rf):
        """"""

# 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


        request = getattr(rf, method)("/", user=account_user)
        kwargs = {"organization_pk": account_account.pk, "user_pk": account_user.pk}
        response = OrgUserReminderView.as_view()(request, **kwargs)
        assert response.status_code == 410

    def test_organization_user_reminder(
        self, rf, account_account, account_user, invitee_user
    ):
        class OrgUserReminderView(base.BaseOrganizationUserRemind):
            org_model = Account
            user_model = AccountUser

        invitee_user.is_active = False
        invitee_user.save()
        account_account.add_user(invitee_user)
        request = rf.get("/", user=account_user)
        kwargs = {"organization_pk": account_account.pk, "user_pk": invitee_user.pk}
        response = OrgUserReminderView.as_view()(request, **kwargs)
        assert response.status_code == 200

        request = rf.post("/")
        request.user = account_user
        response = OrgUserReminderView.as_view()(request, **kwargs)
        assert response.status_code == 302


class TestSignupView:
    def test_anon_user_can_access_signup_view(self, rf):
        """"""

        request = request_factory_login(rf)