# Path: test_abstract/models.py
# class CustomOrganization(AbstractOrganization):
#     street_address = models.CharField(max_length=100, default="")
#     city = models.CharField(max_length=100, default="")
# 
# Path: test_accounts/models.py
# class Account(OrganizationBase):
#     monthly_subscription = models.IntegerField(default=1000)
# 
# Path: test_accounts/models.py
# class AccountInvitation(OrganizationInvitationBase):
# 
#     def get_absolute_url(self):
#         """Returns the invitation URL"""
#         return reverse(
#             "test_accounts:account_invitations:invitations_register",
#             kwargs={"guid": str(self.guid)},
#         )
# 
# Path: test_vendors/models.py
# class Vendor(OrganizationBase):
#     street_address = models.CharField(max_length=100, default="")
#     city = models.CharField(max_length=100, default="")


from django.contrib.auth.models import User
from django.core import mail
from organizations.backends.defaults import InvitationBackend
from organizations.backends.modeled import ModelInvitation
from organizations.base import OrganizationInvitationBase
from organizations.utils import create_organization
from test_abstract.models import CustomOrganization
from test_accounts.models import Account
from test_accounts.models import AccountInvitation
from test_vendors.models import Vendor
import pytest
# -*- coding: utf-8 -*-
"""
Tests for the model based invitation backend
"""





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


@pytest.fixture
def account_account(account_user):

# Path: test_abstract/models.py
# class CustomOrganization(AbstractOrganization):
#     street_address = models.CharField(max_length=100, default="")
#     city = models.CharField(max_length=100, default="")
# 
# Path: test_accounts/models.py
# class Account(OrganizationBase):
#     monthly_subscription = models.IntegerField(default=1000)
# 
# Path: test_accounts/models.py
# class AccountInvitation(OrganizationInvitationBase):
# 
#     def get_absolute_url(self):
#         """Returns the invitation URL"""
#         return reverse(
#             "test_accounts:account_invitations:invitations_register",
#             kwargs={"guid": str(self.guid)},
#         )
# 
# Path: test_vendors/models.py
# class Vendor(OrganizationBase):
#     street_address = models.CharField(max_length=100, default="")
#     city = models.CharField(max_length=100, default="")


# Path: tests/backends/test_model_based_backend.py
from django.contrib.auth.models import User
from django.core import mail
from organizations.backends.defaults import InvitationBackend
from organizations.backends.modeled import ModelInvitation
from organizations.base import OrganizationInvitationBase
from organizations.utils import create_organization
from test_abstract.models import CustomOrganization
from test_accounts.models import Account
from test_accounts.models import AccountInvitation
from test_vendors.models import Vendor
import pytest

# -*- coding: utf-8 -*-
"""
Tests for the model based invitation backend
"""





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


@pytest.fixture
def account_account(account_user):

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