def test_add_root(self): with self.assertNumQueries(1): # just INSERT. There is no parent to be SELECTed UnsortableMaterializedPath.add_root(path_name='Z')
def test_get_root_nodes(self): with self.assertNumQueries(1): # simple SELECT UnsortableMaterializedPath.get_root_nodes().count() # using count() to evaluate query
def test_save_new_instance(self): node = UnsortableMaterializedPath(parent=self.ABADA, path_name='ABADAZ') with self.assertNumQueries(1): # just INSERT (SELECT parent is cached) node.save()