

def test_can_update_objects_with_bypass_enabled(self):
    obj = ModelWithVisibilityField.objects.create(test='initial')
    obj.save()
    self.assertEqual([], list(ModelWithVisibilityField.objects.all()), 'The ModelWithVisibilityField has never been approved and is now pending, so it should be hidden')
    obj.moderated_object.approve(moderated_by=self.user, reason='test')
    obj = ModelWithVisibilityField.objects.get()
    self.assertEqual('initial', obj.test)
    obj.test = 'modified'
    obj.save()
    obj = ModelWithVisibilityField.objects.get()
    self.assertEqual('modified', obj.test)
    automoderate(obj, self.user)
    obj = ModelWithVisibilityField.objects.get()
    self.assertEqual('modified', obj.test)

dataset/ETHPy150Open dominno/django-moderation/tests/tests/regression/testregressions.py BypassOverwritesUpdatedObjectRegressionTestCase.test_can_update_objects_with_bypass_enabled/original