def test_encrypted_update(self):
        access_token = self.get_random_string()
        AccountAccess.objects.filter(pk=self.access.pk).update(access_token=access_token)
        access = AccountAccess.objects.extra(
            select={'raw_token': 'access_token'}
        ).get(pk=self.access.pk)
        self.assertNotEqual(access.raw_token, access_token)
        self.assertTrue(access.raw_token.startswith('$AES$'))
        self.assertEqual(access.access_token, access_token, "Token should be unencrypted on fetch.")
Access token should be encrypted on update.
dataset/ETHPy150Open mlavin/django-all-access/allaccess/tests/test_models.py/AccountAccessTestCase.test_encrypted_update