コード例 #1
0
    def test_storage_type_json_to_db(self):
        entity = Asset(**{'title': 'A storm of swords'})
        denormalized = CassandraRepository.denormalize(entity)

        self.assertDictEqual(denormalized, {
            'blob': '{"key": "%s", "title": "A storm of swords"}' % entity.key.urlsafe()
        })
コード例 #2
0
    def test_storage_type_simple_to_db(self):
        book = Book(**{'title': 'A storm of swords'})
        denormalized = CassandraRepository.denormalize(book)

        self.assertDictEqual(denormalized, {
            'key': book.key.urlsafe(),
            'title': 'A storm of swords'
        })