Exemplo n.º 1
0
class CountryDialcodeModel(TestCase):
    """Test Country, Prefix models"""

    def setUp(self):
        # Country model
        self.country = Country(
            countrycode="ESP",
            iso2='ES',
            countryprefix='34',
            countryname='Spain',
        )
        self.country.save()
        self.assertEqual(self.country.__unicode__(), u'ESP')

        # Prefix model
        self.prefix = Prefix(
            prefix=34,
            destination='Spain',
            country=self.country,
            carrier_name='xyz',
            prefix_type=1
        )
        self.prefix.save()
        self.assertEqual(self.prefix.__unicode__(), u'34')

    def test_country_prefix_name(self):
        self.assertEqual(self.country.countryname, "Spain")
        self.assertEqual(self.prefix.country_name, "Spain")

    def teardown(self):
        self.country.delete()
        self.prefix.delete()
Exemplo n.º 2
0
class CountryDialcodeModel(TestCase):
    """Test Country, Prefix models"""
    def setUp(self):
        # Country model
        self.country = Country(
            countrycode="ESP",
            iso2='ES',
            countryprefix='34',
            countryname='Spain',
        )
        self.country.save()
        self.assertEqual(self.country.__unicode__(), u'ESP')

        # Prefix model
        self.prefix = Prefix(prefix=34,
                             destination='Spain',
                             country=self.country,
                             carrier_name='xyz',
                             prefix_type=1)
        self.prefix.save()
        self.assertEqual(self.prefix.__unicode__(), u'34')

    def test_country_prefix_name(self):
        self.assertEqual(self.country.countryname, "Spain")
        self.assertEqual(self.prefix.country_name, "Spain")

    def teardown(self):
        self.country.delete()
        self.prefix.delete()

    def test_mgt_command(self):
        # Test mgt command
        call_command('load_country_dialcode')
Exemplo n.º 3
0
    def setUp(self):
        # Country model
        self.country = Country(
            countrycode="ESP",
            iso2='ES',
            countryprefix='34',
            countryname='Spain',
        )
        self.country.save()
        self.assertEqual(self.country.__unicode__(), u'ESP')

        # Prefix model
        self.prefix = Prefix(prefix=34,
                             destination='Spain',
                             country=self.country,
                             carrier_name='xyz',
                             prefix_type=1)
        self.prefix.save()
        self.assertEqual(self.prefix.__unicode__(), u'34')
Exemplo n.º 4
0
    def setUp(self):
        # Country model
        self.country = Country(
            countrycode="ESP",
            iso2='ES',
            countryprefix='34',
            countryname='Spain',
        )
        self.country.save()
        self.assertEqual(self.country.__unicode__(), u'ESP')

        # Prefix model
        self.prefix = Prefix(
            prefix=34,
            destination='Spain',
            country=self.country,
            carrier_name='xyz',
            prefix_type=1
        )
        self.prefix.save()
        self.assertEqual(self.prefix.__unicode__(), u'34')