code: def test_lifecycle(self):
      commit = lore.metadata.Commit.create(sha="abc")
      self.assertEqual(commit.__class__, lore.metadata.Commit)
      self.assertIsNotNone(commit.sha)
  
      commit.created_at = datetime.datetime.now()
      commit.save()
  
      all = lore.metadata.Commit.all()
      self.assertEqual(len(all), 1)
  
      first = lore.metadata.Commit.first()
      self.assertEqual(first.sha, commit.sha)
  
      last = lore.metadata.Commit.last()
      self.assertEqual(first.sha, last.sha)
  
      commit.delete()
  
      first = lore.metadata.Commit.first()
      self.assertIsNone(first)
  
file_path: lore/tests/unit/test_metadata.py
imports: import unittest
  import tests.mocks.models_other
  import lore.metadata
  import datetime
label_desc: Use image node_id 1 for calling the TestCrud obj's underlying member method code with example usage: obj.test_lifecycle() without return types