<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_hash(self, build_context):
 """Compute and store the hash of this target for caching purposes. The hash is computed over the target JSON representation. """

        m = md5()
        m.update(self.json(build_context).encode('utf8'))
        self._hash = m.hexdigest()
        m = md5()
        m.update(self.test_json(build_context).encode('utf8'))
        self._test_hash = m.hexdigest()