def test_get_identifier(self): self.assertEqual(get_identifier("core.mockmodel.1"), "core.mockmodel.1") # Valid object. mock = MockModel.objects.get(pk=1) self.assertEqual(get_identifier(mock), "core.mockmodel.1")
def test_searchstack_identifier_method(self): get_identifier = _lookup_identifier_method() self.assertEqual(get_identifier("a.b.c"), "a.b.c")
def remove(self, obj, commit=True): global MOCK_INDEX_DATA if commit is True: del MOCK_INDEX_DATA[get_identifier(obj)]