def test_add_context(self) -> None:
        """Tests that one or more contexts is added and persisted in the DB."""
        observable_obj = hostname.Hostname(value="tomchop.me").save()
        observable_obj.add_context("test_source", {"abc": 123, "def": 456})
        observable_obj.add_context("test_source2", {"abc": 123, "def": 456})

        assert observable_obj.id is not None
        observable_obj = Observable.get(observable_obj.id)
        self.assertEqual(len(observable_obj.context), 2)
        self.assertEqual(observable_obj.context[0]["abc"], 123)
        self.assertEqual(observable_obj.context[0]["source"], "test_source")
        self.assertEqual(observable_obj.context[1]["abc"], 123)
        self.assertEqual(observable_obj.context[1]["source"], "test_source2")
Tests that one or more contexts is added and persisted in the DB.
tests/schemas/observable.py