def test_creation(self):
        rd = self.create_domain(name='130', ip_type='4')
        rd.save()
        try:
            ip = Ip(ip_str="130.193.1.2")  # Forget the ip_type
            ip.clean_ip()

        except __HOLE__, e:
            pass
        self.assertEqual(ValidationError, type(e))

        ip = Ip(ip_str="130.193.1.2", ip_type='4')
        self.assertFalse(ip.ip_upper and ip.ip_lower and ip.reverse_domain)
        ip.clean_ip()
        self.assertTrue(ip.ip_upper == 0 and ip.ip_lower)
dataset/ETHPy150Open mozilla/inventory/mozdns/ip/tests.py/SimpleTest.test_creation