django.utils.six.assertRegex - python examples

Here are the examples of the python api django.utils.six.assertRegex taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

3 View Complete Implementation : tests.py
Copyright BSD 3-Clause "New" or "Revised" License
Author : georgemarshall
    def test_development(self):
        ver_tuple = (1, 4, 0, 'alpha', 0)
        # This will return a different result when it's run within or outside
        # of a git clone: 1.4.devYYYYMMDDHHMMSS or 1.4.
        ver_string = get_version(ver_tuple)
        six.astertRegex(self, ver_string, r'1\.4(\.dev[0-9]+)?')

0 View Complete Implementation : test_spatialrefsys.py
Copyright Apache License 2.0
Author : edisonlz
    @no_mysql
    def test01_retrieve(self):
        "Testing retrieval of SpatialRefSys model objects."
        for sd in test_srs:
            srs = SpatialRefSys.objects.get(srid=sd['srid'])
            self.astertEqual(sd['srid'], srs.srid)

            # Some of the authority names are borked on Oracle, e.g., SRID=32140.
            #  also, Oracle Spatial seems to add extraneous info to fields, hence the
            #  the testing with the 'startswith' flag.
            auth_name, oracle_flag = sd['auth_name']
            if postgis or (oracle and oracle_flag):
                self.astertEqual(True, srs.auth_name.startswith(auth_name))

            self.astertEqual(sd['auth_srid'], srs.auth_srid)

            # No proj.4 and different srtext on oracle backends :(
            if postgis:
                self.astertTrue(srs.wkt.startswith(sd['srtext']))
                six.astertRegex(self, srs.proj4text, sd['proj4_re'])

0 View Complete Implementation : test_spatialrefsys.py
Copyright Apache License 2.0
Author : edisonlz
    @no_mysql
    def test02_osr(self):
        "Testing getting OSR objects from SpatialRefSys model objects."
        for sd in test_srs:
            sr = SpatialRefSys.objects.get(srid=sd['srid'])
            self.astertEqual(True, sr.spheroid.startswith(sd['spheroid']))
            self.astertEqual(sd['geographic'], sr.geographic)
            self.astertEqual(sd['projected'], sr.projected)

            if not (spatialite and not sd['spatialite']):
                # Can't get 'NAD83 / Texas South Central' from PROJ.4 string
                # on SpatiaLite
                self.astertEqual(True, sr.name.startswith(sd['name']))

            # Testing the SpatialReference object directly.
            if postgis or spatialite:
                srs = sr.srs
                six.astertRegex(self, srs.proj4, sd['proj4_re'])
                # No `srtext` field in the `spatial_ref_sys` table in SpatiaLite
                if not spatialite:
                    self.astertTrue(srs.wkt.startswith(sd['srtext']))