

def test_encrypted_fetch(self):
    'Decrypt key/secret on save.'
    key = self.get_random_string()
    secret = self.get_random_string()
    self.provider.consumer_key = key
    self.provider.consumer_secret = secret
    self.provider.save()
    provider = Provider.objects.get(pk=self.provider.pk)
    self.assertEqual(provider.consumer_key, key, 'Could not decrypt key.')
    self.assertEqual(provider.consumer_secret, secret, 'Could not decrypt secret.')

dataset/ETHPy150Open mlavin/django-all-access/allaccess/tests/test_models.py ProviderTestCase.test_encrypted_fetch/original