def test_GetViewCode_with_viewtitle_not_none(self): viewTitle = random_string_generator(5) viewCode = getViewCode(self.pEntity, viewTitle) self.assertEqual(viewCode, slugify(self.pEntity.model.code + '-' + viewTitle))
def test_GetViewDefinition_IsPrimaryTrue(self): self.testRelationShip.isPrimary = True self.testRelationShip.save() self.assertTrue(self.pEntity.property_set.get(isPrimary=True).isPrimary) infoEntity = getViewDefinition(self.pEntity, 'someViewTitle') self.assertEqual(infoEntity['fields'][-1]['physicalName'], '@myStr("info__' + slugify(self.testRelationShip.code) + '")')
def test_GetViewCode_with_viewtitle_none(self): viewCode = getViewCode(self.pEntity) self.assertEqual(viewCode, slugify(self.pEntity.model.code + '-' + self.pEntity.code))
def test_GetViewDefinition_IsEssentialTrue(self): self.testRelationShip.isEssential = True self.testRelationShip.save() #self.assertTrue(self.pEntity.property_set.get(isEssential=True).isEssential) infoEntity = getViewDefinition(self.pEntity, 'someViewTitle') self.assertEqual(''.join(infoEntity['gridConfig']['listDisplay']), 'info__' + slugify(self.testRelationShip.code))