def register_model(self, model): """ Register new model class """ self.models[get_path(model)] = model if model.__name__ not in self.name_to_path: self.name_to_path[model.__name__] = [] self.name_to_path[model.__name__].append(get_path(model))
def test_get_path(self): self.assertEqual("__builtin__.unicode", utils.get_path(unicode)) self.assertEqual("tests.utils.UtilsTest", utils.get_path(UtilsTest))