'Test if the user can see the profile with three type of users.'

def test_can_view_profile(self):

    anon_user = AnonymousUser()
    super_user = User.objects.get(pk=1)
    reg_user = User.objects.get(pk=2)
    profile = Profile.objects.get(pk=1)
    profile.privacy = 'open'
    self.assertTrue(profile.can_view_profile(anon_user))
    self.assertTrue(profile.can_view_profile(super_user))
    self.assertTrue(profile.can_view_profile(reg_user))
    profile.privacy = 'registered'
    self.assertFalse(profile.can_view_profile(anon_user))
    self.assertTrue(profile.can_view_profile(super_user))
    self.assertTrue(profile.can_view_profile(reg_user))
    profile.privacy = 'closed'
    self.assertFalse(profile.can_view_profile(anon_user))
    self.assertTrue(profile.can_view_profile(super_user))
    self.assertFalse(profile.can_view_profile(reg_user))
