# Path: apps/taxonomy/models.py
# class Language(models.Model):
# class TaxonRank(models.Model):
# class TreeCloner():
# class Tree(models.Model):
# class TaxonNameConcept(models.Model):
# class SubtreeHelper():
# class TaxonNode(models.Model):
# class Act(models.Model):
# class Edge(models.Model):
# class TraversalOrder(models.Model):
# class CommonName(models.Model):
# class HybridTaxonNode(models.Model):
# class Filter(models.Model):
#     def __unicode__(self):
#     def __unicode__(self):
#     def clone(new_tree, starting_node):
#     def add_starting_node(new_tree_root, starting_root_node):
#     def __init__(self, new_tree, starting_node):
#     def get_levels(self):
#     def start_cloning(self):
#     def get_cloneable_level_range(self):
#     def clone_level(self, level):
#     def clone_synonyms(self, node, new_node):
#     def update_dependencies_for_new_synonym(self, synonym, new_valid_name):
#     def create_edge_to_self(self, new_synonym):
#     def clone_node(self, node):
#     def connect_with_parent(self, node, new_node, level):
#     def should_connect_with_root_node(self, level):
#     def create_root_node(self):
#     def get_root_children(self):
#     def get_taxon_count(self):
#     def clone_starting_from_taxon_node(self, starting_root_node):
#     def __unicode__(self):
# def tree_post_save(sender, instance, created, **kwargs):
#     def __unicode__(self):
#     def find_last_traversal_node(taxonnode):
#     def taxon_name(self):
#     def remarks(self):
#     def citation_text(self):
#     def full_taxon_name(self):
#     def taxon_name_with_tree(self):
#     def __unicode__(self):
#     def get_validity(self):
#     def is_root_node(self):
#     def detach_from_tree_until_node(self, new_root):
#     def detach_subtree_from_tree(self):
#     def attach_with_parent(self, new_parent):
#     def attach_with_tree_outside_of_subtree(self, subtree_root):
#     def attach_subtree_with_parent(self, new_parent):
#     def set_new_parent(self, new_parent):
#     def add_subtree_to_traversal_order(self, new_parent, last_traversal):
#     def remove_subtree_from_traversal_order(self, last_traversal, attachEnds=False):
#     def get_children_ids(self):
#     def get_children(self):
#     def create_edges(self, parent=None):
#     def create_traversal_node(self, previous_taxon_id):
#     def get_one_first_level_taxonnode(self):
#     def insert_to_traversal_order(self):
#     def remove_from_traversal_order(self):
#     def clean_fields(self, exclude):
#     def subtree(self):
#     def higher_taxa(self, levels):
#     def taxa_intersection(ids1, ids2):
#     def higher_taxa_intersection(self, given_ids):
#     def get_related_taxa(self):
#     def get_synonyms(self):
#     def get_hybrid_parents(self):
#     def get_next_taxon(self):
#     def get_previous_taxon(self):
#     def get_depth(self):
#     def get_parent(self):
#     def apply_filter(filter, queryset):
#     def create_post_created_act(self, remarks, citation_text):
#     def post_created(self, **kwargs):
#     def does_exist_in_tree(self):
#     def does_exist_is_traversal_order(self):
#     def post_changed(self, **kwargs):
#     def has_parent_changed(self, new_parent):
#     def has_changed(self, field_name):
#     def remove_non_self_edges(self):
#     def remove_all_edges(self):
#     def transfer_synonyms_to(self, new_valid_name):
#     def change_current_to_synonym(self, new_valid_name):
#     def can_delete(self):
#     def mark_as_deleted(self):
# def taxon_node_pre_save(sender, instance, *args, **kwargs):
# def taxon_node_post_save(sender, instance, created, **kwargs):
#     def create(previous_taxon_id, current_id):
#     def remove(self):
#     def __unicode__(self):
#     def rank(self):
#     def __unicode__(self):
# SYNONYM_TYPES = (
#                 ('synonym', _('Synonym')),
#                 ('basionym', _('Basionym')),
#                 ('invalid', _('Invalid'))
# )
# NOMEN_STATUSES = (
#                  ('established', _('Established')),
#                  ('compliant', _('Compliant')),
#                  ('non-compliant', _('Non-compliant')),
#                  ('registered', _('Registered'))
# )
# ACT_TYPES = (
#             ('new_taxon', _('New taxon node created')),
#             ('marked_as_synonym', _('Taxon node was marked as a synonym')),
#             ('marked_as_basionym', _('Taxon node was marked as a basionym')),
#             ('marked_as_current', _('Taxon node was marked as a current')),
#             ('change_parent', _('Taxon node parent was changed')),
#             ('edit_name', _('Taxon node name was edited')),
#             ('change_nomen_status', _('Taxon node\'s nomenclatural status was changed')),
#             ('delete_taxon', _('Taxon node name was deleted')),
# )


import factory
from apps.taxonomy import models


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 ActFactory(factory.django.DjangoModelFactory):
    taxon_node = factory.SubFactory(TaxonNodeFactory)
    type = 'new_taxon'

    class Meta:
        model = models.Act


class EdgeFactory(factory.django.DjangoModelFactory):
    ancestor = factory.SubFactory(TaxonNodeFactory)
    descendant = factory.SubFactory(TaxonNodeFactory)
    length = 1

    class Meta:

# Path: apps/taxonomy/models.py
# class Language(models.Model):
# class TaxonRank(models.Model):
# class TreeCloner():
# class Tree(models.Model):
# class TaxonNameConcept(models.Model):
# class SubtreeHelper():
# class TaxonNode(models.Model):
# class Act(models.Model):
# class Edge(models.Model):
# class TraversalOrder(models.Model):
# class CommonName(models.Model):
# class HybridTaxonNode(models.Model):
# class Filter(models.Model):
#     def __unicode__(self):
#     def __unicode__(self):
#     def clone(new_tree, starting_node):
#     def add_starting_node(new_tree_root, starting_root_node):
#     def __init__(self, new_tree, starting_node):
#     def get_levels(self):
#     def start_cloning(self):
#     def get_cloneable_level_range(self):
#     def clone_level(self, level):
#     def clone_synonyms(self, node, new_node):
#     def update_dependencies_for_new_synonym(self, synonym, new_valid_name):
#     def create_edge_to_self(self, new_synonym):
#     def clone_node(self, node):
#     def connect_with_parent(self, node, new_node, level):
#     def should_connect_with_root_node(self, level):
#     def create_root_node(self):
#     def get_root_children(self):
#     def get_taxon_count(self):
#     def clone_starting_from_taxon_node(self, starting_root_node):
#     def __unicode__(self):
# def tree_post_save(sender, instance, created, **kwargs):
#     def __unicode__(self):
#     def find_last_traversal_node(taxonnode):
#     def taxon_name(self):
#     def remarks(self):
#     def citation_text(self):
#     def full_taxon_name(self):
#     def taxon_name_with_tree(self):
#     def __unicode__(self):
#     def get_validity(self):
#     def is_root_node(self):
#     def detach_from_tree_until_node(self, new_root):
#     def detach_subtree_from_tree(self):
#     def attach_with_parent(self, new_parent):
#     def attach_with_tree_outside_of_subtree(self, subtree_root):
#     def attach_subtree_with_parent(self, new_parent):
#     def set_new_parent(self, new_parent):
#     def add_subtree_to_traversal_order(self, new_parent, last_traversal):
#     def remove_subtree_from_traversal_order(self, last_traversal, attachEnds=False):
#     def get_children_ids(self):
#     def get_children(self):
#     def create_edges(self, parent=None):
#     def create_traversal_node(self, previous_taxon_id):
#     def get_one_first_level_taxonnode(self):
#     def insert_to_traversal_order(self):
#     def remove_from_traversal_order(self):
#     def clean_fields(self, exclude):
#     def subtree(self):
#     def higher_taxa(self, levels):
#     def taxa_intersection(ids1, ids2):
#     def higher_taxa_intersection(self, given_ids):
#     def get_related_taxa(self):
#     def get_synonyms(self):
#     def get_hybrid_parents(self):
#     def get_next_taxon(self):
#     def get_previous_taxon(self):
#     def get_depth(self):
#     def get_parent(self):
#     def apply_filter(filter, queryset):
#     def create_post_created_act(self, remarks, citation_text):
#     def post_created(self, **kwargs):
#     def does_exist_in_tree(self):
#     def does_exist_is_traversal_order(self):
#     def post_changed(self, **kwargs):
#     def has_parent_changed(self, new_parent):
#     def has_changed(self, field_name):
#     def remove_non_self_edges(self):
#     def remove_all_edges(self):
#     def transfer_synonyms_to(self, new_valid_name):
#     def change_current_to_synonym(self, new_valid_name):
#     def can_delete(self):
#     def mark_as_deleted(self):
# def taxon_node_pre_save(sender, instance, *args, **kwargs):
# def taxon_node_post_save(sender, instance, created, **kwargs):
#     def create(previous_taxon_id, current_id):
#     def remove(self):
#     def __unicode__(self):
#     def rank(self):
#     def __unicode__(self):
# SYNONYM_TYPES = (
#                 ('synonym', _('Synonym')),
#                 ('basionym', _('Basionym')),
#                 ('invalid', _('Invalid'))
# )
# NOMEN_STATUSES = (
#                  ('established', _('Established')),
#                  ('compliant', _('Compliant')),
#                  ('non-compliant', _('Non-compliant')),
#                  ('registered', _('Registered'))
# )
# ACT_TYPES = (
#             ('new_taxon', _('New taxon node created')),
#             ('marked_as_synonym', _('Taxon node was marked as a synonym')),
#             ('marked_as_basionym', _('Taxon node was marked as a basionym')),
#             ('marked_as_current', _('Taxon node was marked as a current')),
#             ('change_parent', _('Taxon node parent was changed')),
#             ('edit_name', _('Taxon node name was edited')),
#             ('change_nomen_status', _('Taxon node\'s nomenclatural status was changed')),
#             ('delete_taxon', _('Taxon node name was deleted')),
# )


# Path: apps/taxonomy/tests/factories.py
import factory
from apps.taxonomy import models



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 ActFactory(factory.django.DjangoModelFactory):
    taxon_node = factory.SubFactory(TaxonNodeFactory)
    type = 'new_taxon'

    class Meta:
        model = models.Act


class EdgeFactory(factory.django.DjangoModelFactory):
    ancestor = factory.SubFactory(TaxonNodeFactory)
    descendant = factory.SubFactory(TaxonNodeFactory)
    length = 1

    class Meta:

        model = models.Edge