incuna/django-pgcrypto-fields — pull request #15 by KevinEtienne (2014-12-09 17:25:01+00:00)
Title: Find workaround for django bug

The following code will make Django use a string representation of a memory view

```python
def test_update_one_attribute(self):
"""Test django bug."""
expected = 'bonjour'
instance = EncryptedTextFieldModelFactory.create(pgp_pub_field=expected)

instance.pgp_sym_field = 'new value'
instance.save()

updated_instance = self.model.objects.get()
self.assertEqual(updated_instance.pgp_pub_field_decrypted, expected)
```

```bash
Creating test database for alias 'default'...
............F.....
======================================================================
FAIL: test_update_one_attribute (tests.test_fields.TestEncryptedTextFieldModel)
----------------------------------------------------------------------
Traceback (most recent call last):
File "django-pgcrypto-fields/tests/test_fields.py", line 196, in test_update_one_attribute
self.assertEqual(updated_instance.pgp_pub_field_decrypted, expected)
AssertionError: '' != 'bonjour'
-
+ bonjour
```