# Path: apps/taxonomy/tests/base.py
# class TaxonomyUnauthorizedTestMixin(UnauthorizedTestMixin):
# 
#     def setUp(self):
#         super(TaxonomyUnauthorizedTestMixin, self).setUp()
#         factories.TaxonRankFactory(id=0)
# 
# class TaxonomyUserTestMixin(UserTestMixin):
# 
#     def setUp(self):
#         super(TaxonomyUserTestMixin, self).setUp()
#         factories.TaxonRankFactory(id=0)
# 
# class TaxonomyAdminTestMixin(AdminTestMixin):
# 
#     def setUp(self):
#         super(TaxonomyAdminTestMixin, self).setUp()
#         factories.TaxonRankFactory(id=0)
# 
# Path: apps/taxonomy/tests/factories.py
# class HybridTaxonNodeFactory(factory.django.DjangoModelFactory):
#     taxon_node = factory.SubFactory(TaxonNodeFactory)
#     hybrid_parent1 = factory.SubFactory(TaxonNodeFactory)
#     hybrid_parent2 = factory.SubFactory(TaxonNodeFactory)
# 
#     class Meta:
#         model = models.HybridTaxonNode
# 
# class TaxonNodeFactory(factory.django.DjangoModelFactory):
#     tree = factory.SubFactory(TreeFactory)
#     epithet = 'kingdom'
#     parent_described_in = None
#     valid_name = None
#     taxon_rank = factory.SubFactory(TaxonRankFactory)
#     taxon_name_concept = None
#     epithet_author = 'author'
#     is_fossil = False
# 
#     class Meta:
#         model = models.TaxonNode
# 
# class TreeFactory(factory.django.DjangoModelFactory):
#     name = 'Tree 1'
#     origin_tree = None
#     root_node = None  # factory.SubFactory(TaxonNodeFactory)
# 
#     class Meta:
#         model = models.Tree


from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from apps.taxonomy.tests.base import TaxonomyUnauthorizedTestMixin, TaxonomyUserTestMixin, TaxonomyAdminTestMixin
from apps.taxonomy.tests.factories import HybridTaxonNodeFactory, TaxonNodeFactory, TreeFactory



class HybridTaxonNodeBase(APITestCase):

    def get_obj_url(self):
        obj = HybridTaxonNodeFactory()
        return reverse('hybridtaxonnode-detail', args=[obj.id]), obj

    @staticmethod
    def get_url():
        return reverse('hybridtaxonnode-list')

    def get_raw_data(self):
        data = {"taxon_node": reverse('taxonnode-detail', args=[TaxonNodeFactory(tree=TreeFactory()).id]),

# Path: apps/taxonomy/tests/base.py
# class TaxonomyUnauthorizedTestMixin(UnauthorizedTestMixin):
# 
#     def setUp(self):
#         super(TaxonomyUnauthorizedTestMixin, self).setUp()
#         factories.TaxonRankFactory(id=0)
# 
# class TaxonomyUserTestMixin(UserTestMixin):
# 
#     def setUp(self):
#         super(TaxonomyUserTestMixin, self).setUp()
#         factories.TaxonRankFactory(id=0)
# 
# class TaxonomyAdminTestMixin(AdminTestMixin):
# 
#     def setUp(self):
#         super(TaxonomyAdminTestMixin, self).setUp()
#         factories.TaxonRankFactory(id=0)
# 
# Path: apps/taxonomy/tests/factories.py
# class HybridTaxonNodeFactory(factory.django.DjangoModelFactory):
#     taxon_node = factory.SubFactory(TaxonNodeFactory)
#     hybrid_parent1 = factory.SubFactory(TaxonNodeFactory)
#     hybrid_parent2 = factory.SubFactory(TaxonNodeFactory)
# 
#     class Meta:
#         model = models.HybridTaxonNode
# 
# class TaxonNodeFactory(factory.django.DjangoModelFactory):
#     tree = factory.SubFactory(TreeFactory)
#     epithet = 'kingdom'
#     parent_described_in = None
#     valid_name = None
#     taxon_rank = factory.SubFactory(TaxonRankFactory)
#     taxon_name_concept = None
#     epithet_author = 'author'
#     is_fossil = False
# 
#     class Meta:
#         model = models.TaxonNode
# 
# class TreeFactory(factory.django.DjangoModelFactory):
#     name = 'Tree 1'
#     origin_tree = None
#     root_node = None  # factory.SubFactory(TaxonNodeFactory)
# 
#     class Meta:
#         model = models.Tree


# Path: apps/taxonomy/tests/acceptance_tests/test_hybrid_api.py
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from apps.taxonomy.tests.base import TaxonomyUnauthorizedTestMixin, TaxonomyUserTestMixin, TaxonomyAdminTestMixin
from apps.taxonomy.tests.factories import HybridTaxonNodeFactory, TaxonNodeFactory, TreeFactory




class HybridTaxonNodeBase(APITestCase):

    def get_obj_url(self):
        obj = HybridTaxonNodeFactory()
        return reverse('hybridtaxonnode-detail', args=[obj.id]), obj

    @staticmethod
    def get_url():
        return reverse('hybridtaxonnode-list')

    def get_raw_data(self):
        data = {"taxon_node": reverse('taxonnode-detail', args=[TaxonNodeFactory(tree=TreeFactory()).id]),

                "hybrid_parent1": reverse('taxonnode-detail', args=[TaxonNodeFactory(tree=TreeFactory()).id]),