예제 #1
0
 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))
예제 #2
0
    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) + '")')
예제 #3
0
 def test_GetViewCode_with_viewtitle_none(self):
     viewCode = getViewCode(self.pEntity)
     self.assertEqual(viewCode, slugify(self.pEntity.model.code + '-' + self.pEntity.code))
예제 #4
0
    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))