def testDjangoModel( self ): dj= X12.map.dj.DjangoModelVisitor( ) parse_278.visit( dj ) text= dj.getSource(appname='claims_837') #print( "***Manual Inspection" ) #print( text ) sample='''\ from web.claims.models import X12Segment from django.db import models class Segment_ISA(models.Model): """Properties()""" segment = models.ForeignKey( X12Segment ) def unmarshall( self, segmentToken, cs=':' ): class Segment_GS(models.Model): """Properties()""" segment = models.ForeignKey( X12Segment ) def unmarshall( self, segmentToken, cs=':' ): class Segment_ST(models.Model): """Properties(qual=(1, '278'),req_sit='R',repeat='1',desc='Transaction Set Header')""" segment = models.ForeignKey( X12Segment ) ST01 = models.CharField( max_length=16, null=True, blank=True ) # None None def unmarshall( self, segmentToken, cs=':' ): self.ST01 = segmentToken.elt(1) ''' tLines= text.splitlines() sLines= sample.splitlines() for i in range(len(sLines)): self.assertEqual( tLines[i].rstrip(), sLines[i].rstrip() )
def testDjangoAdmin( self ): dj= X12.map.dj.DjangoAdminVisitor( ) parse_278.visit( dj ) text= dj.getSource(appname='claims_837') #print( "***Manual Inspection" ) #print( text ) sample= '''\ from web.claims_837.models import NM1 admin.site.register( NM1 ) from web.claims_837.models import PER admin.site.register( PER ) from web.claims_837.models import CRC admin.site.register( CRC ) from web.claims_837.models import ST admin.site.register( ST ) from web.claims_837.models import HL admin.site.register( HL ) from web.claims_837.models import MSG admin.site.register( MSG ) from web.claims_837.models import ISA admin.site.register( ISA ) from web.claims_837.models import DTP admin.site.register( DTP ) from web.claims_837.models import REF admin.site.register( REF ) from web.claims_837.models import HSD admin.site.register( HSD ) from web.claims_837.models import DMG admin.site.register( DMG ) from web.claims_837.models import PRV admin.site.register( PRV ) from web.claims_837.models import CL1 admin.site.register( CL1 ) from web.claims_837.models import GS admin.site.register( GS ) from web.claims_837.models import TRN admin.site.register( TRN ) from web.claims_837.models import GE admin.site.register( GE ) from web.claims_837.models import IEA admin.site.register( IEA ) from web.claims_837.models import N3 admin.site.register( N3 ) from web.claims_837.models import N4 admin.site.register( N4 ) from web.claims_837.models import CR2 admin.site.register( CR2 ) from web.claims_837.models import CR1 admin.site.register( CR1 ) from web.claims_837.models import CR6 admin.site.register( CR6 ) from web.claims_837.models import CR5 admin.site.register( CR5 ) from web.claims_837.models import INS admin.site.register( INS ) from web.claims_837.models import UM admin.site.register( UM ) from web.claims_837.models import HI admin.site.register( HI ) from web.claims_837.models import BHT admin.site.register( BHT ) from web.claims_837.models import SE admin.site.register( SE ) ''' tLines= text.splitlines() sLines= sample.splitlines() for i in range(len(sLines)): self.assertEqual( tLines[i].rstrip(), sLines[i].rstrip() )