Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/api/test_deposit_list.py
# Copyright (C) 2017-2018 The Software Heritage developers | # Copyright (C) 2017-2018 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from django.core.urlresolvers import reverse | from django.core.urlresolvers import reverse | ||||
from nose.tools import istest | |||||
from nose.plugins.attrib import attr | from nose.plugins.attrib import attr | ||||
from rest_framework import status | from rest_framework import status | ||||
from rest_framework.test import APITestCase | from rest_framework.test import APITestCase | ||||
from swh.deposit.api.converters import convert_status_detail | from swh.deposit.api.converters import convert_status_detail | ||||
from ...config import DEPOSIT_STATUS_PARTIAL, PRIVATE_LIST_DEPOSITS | from ...config import DEPOSIT_STATUS_PARTIAL, PRIVATE_LIST_DEPOSITS | ||||
from ..common import BasicTestCase, WithAuthTestCase, CommonCreationRoutine | from ..common import BasicTestCase, WithAuthTestCase, CommonCreationRoutine | ||||
from ...models import Deposit | from ...models import Deposit | ||||
@attr('fs') | @attr('fs') | ||||
class CheckDepositListTest(APITestCase, WithAuthTestCase, | class CheckDepositListTest(APITestCase, WithAuthTestCase, | ||||
BasicTestCase, CommonCreationRoutine): | BasicTestCase, CommonCreationRoutine): | ||||
"""Check deposit list endpoints. | """Check deposit list endpoints. | ||||
""" | """ | ||||
def setUp(self): | def setUp(self): | ||||
super().setUp() | super().setUp() | ||||
@istest | def test_deposit_list(self): | ||||
def deposit_list(self): | |||||
"""Deposit list api should return the deposits | """Deposit list api should return the deposits | ||||
""" | """ | ||||
deposit_id = self.create_deposit_partial() | deposit_id = self.create_deposit_partial() | ||||
# amend the deposit with a status_detail | # amend the deposit with a status_detail | ||||
deposit = Deposit.objects.get(pk=deposit_id) | deposit = Deposit.objects.get(pk=deposit_id) | ||||
status_detail = { | status_detail = { | ||||
'url': { | 'url': { | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |