class GenericProfileTest(EntityTentdTestCase): def before(self): super(GenericProfileTest, self).before() self.profile = GenericProfile( entity=self.entity, schema="https://tent.io/types/info/example/v0.0.0", content={ 'attr': 'value', 'dict': {'attr': 'value'}, 'list': [1, 2, 3], }) self.profile.save() def test_attributes(self): assert self.profile.content['dict']['attr'] == 'value' def test_json_attributes(self): profile = Profile.objects.get(id=self.profile.id) assert profile.to_json()['content']['dict']['attr'] == 'value' def test_unique_schema(self): with self.assertRaises(NotUniqueError): GenericProfile( entity=self.entity, schema="https://tent.io/types/info/example/v0.0.0").save()
class GenericProfileTest(EntityTentdTestCase): def before(self): super(GenericProfileTest, self).before() self.profile = GenericProfile( entity=self.entity, schema="https://tent.io/types/info/example/v0.0.0", content={ 'attr': 'value', 'dict': { 'attr': 'value' }, 'list': [1, 2, 3], }) self.profile.save() def test_attributes(self): assert self.profile.content['dict']['attr'] == 'value' def test_json_attributes(self): profile = Profile.objects.get(id=self.profile.id) assert profile.to_json()['content']['dict']['attr'] == 'value' def test_unique_schema(self): with self.assertRaises(NotUniqueError): GenericProfile( entity=self.entity, schema="https://tent.io/types/info/example/v0.0.0").save()
def before(self): super(GenericProfileTest, self).before() self.profile = GenericProfile( entity=self.entity, schema="https://tent.io/types/info/example/v0.0.0", content={ 'attr': 'value', 'dict': { 'attr': 'value' }, 'list': [1, 2, 3], }) self.profile.save()
def before(self): super(GenericProfileTest, self).before() self.profile = GenericProfile( entity=self.entity, schema="https://tent.io/types/info/example/v0.0.0", content={ 'attr': 'value', 'dict': {'attr': 'value'}, 'list': [1, 2, 3], }) self.profile.save()
def test_unique_schema(self): with self.assertRaises(NotUniqueError): GenericProfile( entity=self.entity, schema="https://tent.io/types/info/example/v0.0.0").save()