# Path: karaage/tests/fixtures.py
# class InstituteFactory(DjangoModelFactory):
#     name = fuzzy_lower_text(prefix='inst-')
#     group = factory.SubFactory(GroupFactory)
# 
#     class Meta:
#         model = karaage.institutes.models.Institute
#         django_get_or_create = ('name',)
# 
# class PersonFactory(DjangoModelFactory):
#     username = fuzzy_lower_text(prefix='person-')
#     password = make_password('test')
#     full_name = factory.LazyAttribute(lambda a: a.username.title()[:50])
#     short_name = factory.LazyAttribute(lambda a: a.username.title()[:30])
#     email = factory.LazyAttribute(
#         lambda a: '{0}@example.com'.format(a.username[:62]).lower())
#     institute = factory.LazyAttribute(
#         lambda a: InstituteFactory(
#             name=fuzzy_lower_text(prefix='%s-inst-' % a.username)))
# 
#     class Meta:
#         model = karaage.people.models.Person
#         django_get_or_create = ('username',)
# 
# class ProjectFactory(DjangoModelFactory):
#     pid = fuzzy_lower_text(prefix='proj-')
#     name = factory.LazyAttribute(lambda a: a.pid.title()[:200])
#     institute = factory.SubFactory(InstituteFactory)
#     is_approved = True
#     approved_by = factory.LazyAttribute(
#         lambda a: PersonFactory(
#             username=fuzzy_lower_text(prefix='%s-acc-' % a.pid)))
#     is_active = True
# 
#     class Meta:
#         model = karaage.projects.models.Project
# 
# def fuzzy_lower_text(*args, **kwargs):
#     if 'chars' not in kwargs:
#         kwargs['chars'] = 'abcdefghijklmnopqrstuvwxyz'
#     return FuzzyText(*args, **kwargs)


    import factory
    from factory.django import DjangoModelFactory
    from factory.fuzzy import FuzzyText
from karaage.tests.fixtures import (
    InstituteFactory,
    PersonFactory,
    ProjectFactory,
    fuzzy_lower_text,
)
from ..models import Application, ProjectApplication
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Karaage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Karaage  If not, see <http://www.gnu.org/licenses/>.

try:
except ImportError:
    raise ImportError(
        "factory_boy is required, "
        "either install from a package or using \'pip install -e .[tests]\'")




class ApplicationFactory(DjangoModelFactory):
    existing_person = factory.SubFactory(PersonFactory)

    class Meta:
        model = Application


class ProjectApplicationFactory(ApplicationFactory):


# Path: karaage/tests/fixtures.py
# class InstituteFactory(DjangoModelFactory):
#     name = fuzzy_lower_text(prefix='inst-')
#     group = factory.SubFactory(GroupFactory)
# 
#     class Meta:
#         model = karaage.institutes.models.Institute
#         django_get_or_create = ('name',)
# 
# class PersonFactory(DjangoModelFactory):
#     username = fuzzy_lower_text(prefix='person-')
#     password = make_password('test')
#     full_name = factory.LazyAttribute(lambda a: a.username.title()[:50])
#     short_name = factory.LazyAttribute(lambda a: a.username.title()[:30])
#     email = factory.LazyAttribute(
#         lambda a: '{0}@example.com'.format(a.username[:62]).lower())
#     institute = factory.LazyAttribute(
#         lambda a: InstituteFactory(
#             name=fuzzy_lower_text(prefix='%s-inst-' % a.username)))
# 
#     class Meta:
#         model = karaage.people.models.Person
#         django_get_or_create = ('username',)
# 
# class ProjectFactory(DjangoModelFactory):
#     pid = fuzzy_lower_text(prefix='proj-')
#     name = factory.LazyAttribute(lambda a: a.pid.title()[:200])
#     institute = factory.SubFactory(InstituteFactory)
#     is_approved = True
#     approved_by = factory.LazyAttribute(
#         lambda a: PersonFactory(
#             username=fuzzy_lower_text(prefix='%s-acc-' % a.pid)))
#     is_active = True
# 
#     class Meta:
#         model = karaage.projects.models.Project
# 
# def fuzzy_lower_text(*args, **kwargs):
#     if 'chars' not in kwargs:
#         kwargs['chars'] = 'abcdefghijklmnopqrstuvwxyz'
#     return FuzzyText(*args, **kwargs)


# Path: karaage/plugins/kgapplications/tests/fixtures.py
    import factory
    from factory.django import DjangoModelFactory
    from factory.fuzzy import FuzzyText
from karaage.tests.fixtures import (
    InstituteFactory,
    PersonFactory,
    ProjectFactory,
    fuzzy_lower_text,
)
from ..models import Application, ProjectApplication

# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Karaage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Karaage  If not, see <http://www.gnu.org/licenses/>.

try:
except ImportError:
    raise ImportError(
        "factory_boy is required, "
        "either install from a package or using \'pip install -e .[tests]\'")




class ApplicationFactory(DjangoModelFactory):
    existing_person = factory.SubFactory(PersonFactory)

    class Meta:
        model = Application


class ProjectApplicationFactory(ApplicationFactory):


    class Meta: