

def test_profile_view(self):
    'Lets user view their profile details.'
    self.build_to_organizations()
    test_url = reverse('users:profile')
    response = self.client.get(test_url)
    self.assertEqual(response.status_code, 302)
    self.client.login(username='testuser0', password='pw')
    response = self.client.get(test_url)
    self.assertEqual(response.status_code, 200)
    self.assertTrue(('testuser0' in response.content.decode()))
    for user in User.objects.all():
        if (user.username == 'testuser0'):
            break
    for org in user.organization_set.all():
        self.assertTrue((org.name in response.content.decode()))

dataset/ETHPy150Open openlearningtools/opencompetencies/users/tests.py UserViewTests.test_profile_view/original