Remove deprecation warnings from unittests

Use assertEqual over the deprecated assertEquals method from unittest.
The later generates deprecation warnings.
Prevent begins setting unprotected properties

Ensure that begins can only modify context properties that are protected
from userspace code.