corrects tests for latest code changes

This commit is contained in:
Mouse Reeve
2020-11-07 17:48:50 -08:00
parent 20395ff2ec
commit cfa4cb015d
8 changed files with 22 additions and 73 deletions

View File

@ -76,11 +76,12 @@ class ActivityObject:
if not isinstance(self, model.activity_serializer):
raise TypeError('Wrong activity type for model')
# check for an existing instance
try:
return model.objects.get(remote_id=self.id)
except model.DoesNotExist:
pass
# check for an existing instance, if we're not updating a known obj
if not instance:
try:
return model.objects.get(remote_id=self.id)
except model.DoesNotExist:
pass
model_fields = [m.name for m in model._meta.get_fields()]
mapped_fields = {}