Esempio n. 1
0
def test_universities(logged_in):
    UniversityFactory.create_batch(11, is_verified=False)
    UniversityFactory.create_batch(12, is_verified=True)
    response = logged_in.client.get(reverse('universities:universities'))

    assert response.status_code == 200
    response = response.json()

    assert response['count'] == 12
    assert len(response['results']) == 12
Esempio n. 2
0
def test_university_retrieve_list(logged_in_admin):
    university = UniversityFactory()
    response = logged_in_admin.client.get(
        reverse('admins:university-detail', kwargs={'pk': university.pk}))

    assert response.status_code == 200
    assert response.json()['name'] == university.name

    UniversityFactory.create_batch(10)

    response = logged_in_admin.client.get(reverse('admins:university-list'))

    assert response.status_code == 200
    assert len(response.json()['results']) == 11