def __test_nullable_field_helper(self, TestModel):
        tm = TestModel()
        tm.save()

        pk = tm.id
        tm = TestModel.objects.get(pk=pk)
        self.assertIsNone(tm.phone)

        # ensure that null values do not cause uniqueness conflicts
        self.assertEqual(TestModel.objects.count(), 1)
        TestModel.objects.create()
        self.assertEqual(TestModel.objects.count(), 2)
Helper method for the next four tests.
dataset/ETHPy150Open stefanfoulis/django-phonenumber-field/testproject/testapp/tests.py/PhonenumerFieldAppTest.__test_nullable_field_helper