def test_model_User_profile(self):
        """Test User model"""
        username = "testusername"
        password = "password"
        user = DjangoUser(username=username)
        user.set_password(password)
        user.save()
        self.assertEquals(user.username, username)
        self.assertIsNotNone(user.id)
        profile = user.profile
        self.assertEquals(profile.name, username)
        self.assertEquals(profile.default_group, Group.objects.all()[0])
        self.assertQuerysetEqual(profile.other_groups.all(), [])
        self.assertFalse(profile.disabled)
        self.assertTrue(datetime.timedelta(seconds=1) < profile.last_access - datetime.datetime.now())
        self.assertEqual(profile.get_absolute_url(), '/contacts/user/view/{}'.format(profile.id))
        oldpsw = profile.user.password
        self.assertNotEqual(profile.generate_new_password(), oldpsw)
        self.assertQuerysetEqual(profile.get_groups(), map(repr, [profile.default_group]))
        self.assertTrue(profile.is_admin())
        self.assertEqual(profile.get_username(), username)
        self.assertEqual(profile.get_perspective(), Perspective.objects.get(name='Default'))
        self.assertEqual(profile.get_contact(), Contact.objects.get(related_user=profile))
        self.assertTrue(profile.has_contact())

        self.assertEqual(profile.__unicode__(), username)
dataset/ETHPy150Open treeio/treeio/treeio/core/tests.py/CoreModelsTest.test_model_User_profile/swapped operands of `<`