'''
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''

import os
from tests import test_settings
from tests.base_test import ArchesTestCase
from arches.app.models import models

# these tests can be run from the command line via
# python manage.py test tests --pattern="*.py" --settings="tests.test_settings"


class ResourceGraphTests(ArchesTestCase):

    def test_initial_node_import(self):
        """
        Test that correct number of nodes load

        """
        from arches.management.commands.package_utils import resource_graphs
        from arches.app.models.models import Node

        resource_graphs.load_graphs(os.path.join(test_settings.RESOURCE_GRAPH_LOCATIONS))

        self.assertEqual(Node.objects.count(), 117)


    # def test_intial_edge_import(self):
    #     """
    #     Test that correct number of edges load

    #     """

@@ -901,16 +901,127 @@
 t models
+%0Afrom arches.management.commands.package_utils import resource_graphs%0Afrom arches.app.models.models import Node
 %0A%0A# thes
@@ -1302,24 +1302,25 @@
     %22%22%22%0A
+%0A
         
 from arc
@@ -1315,126 +1315,43 @@
     
-from arches.management.commands.package_utils import resource_graphs%0A        from arches.app.models.models import Node
+count_before = Node.objects.count()
 %0A%0A  
@@ -1488,13 +1488,26 @@
 nt()
+-count_before
 , 11
-7
+2
 )%0A%0A%0A

fix broken test