Esempio n. 1
0
    def test_all_fields(self):
        KennelDataModel(self.kennel_id,
                        name=self.name,
                        acronym=self.acronym,
                        region=self.region,
                        contact=self.contact,
                        webpage=self.webpage,
                        facebook=self.facebook,
                        founding=self.founding,
                        description=self.description).save()

        kennel = KennelDataModel.get(self.kennel_id)
        self.assertEqual(kennel.region, self.region)
        self.assertEqual(kennel.contact, self.contact)
        self.assertEqual(kennel.webpage, self.webpage)
        self.assertEqual(kennel.facebook, self.facebook)
        self.assertEqual(kennel.founding, self.founding)
        self.assertEqual(kennel.description, self.description)
        self.assertEqual(kennel.searchable_name,
                         kennel.searchable_value(kennel.name))
        self.assertEqual(kennel.searchable_acronym,
                         kennel.searchable_value(kennel.acronym))
Esempio n. 2
0
 def lookup_by_id(kennel_id):
     result = KennelDataModel.get(kennel_id)
     attribute_dict = result.attributes()
     attribute_dict['persistence_object'] = result
     attribute_dict['kennel_id'] = kennel_id
     return KennelLogicModel(**attribute_dict)