from rest_framework.test import APIClient
from rest_framework import status
-from genericparser.packages.biz.nsdm_subscription import NsdmSubscription
-from genericparser.pub.database.models import NsdmSubscriptionModel
+from catalog.packages.biz.nsdm_subscription import NsdmSubscription
+from catalog.pub.database.models import NsdmSubscriptionModel
class TestNsdmSubscription(TestCase):
expected_data = {
'status': 303,
'detail': 'Already Subscription exists with'
- ' the same callbackUri and filter',
+ ' the same callbackUri and filter'
}
response = self.client.post("/api/nsd/v1/subscriptions",
data=self.subscription, format='json')
mock_requests.get.return_value.status_code = 204
expected_data = {
'status': 400,
- 'detail': 'Auth type should be BASIC',
+ 'detail': 'Auth type should be BASIC'
}
response = self.client.post("/api/nsd/v1/subscriptions",
data=dummy_subscription, format='json')
mock_requests.get.return_value.status_code = 204
expected_data = {
'status': 400,
- 'detail': 'Auth type should be OAUTH2_CLIENT_CREDENTIALS',
+ 'detail': 'Auth type should be OAUTH2_CLIENT_CREDENTIALS'
}
response = self.client.post("/api/nsd/v1/subscriptions",
data=dummy_subscription, format='json')
mock_requests.get.return_value.status_code = 204
expected_data = {
'status': 400,
- 'detail': 'userName and password needed for BASIC',
+ 'detail': 'userName and password needed for BASIC'
}
response = self.client.post("/api/nsd/v1/subscriptions",
data=dummy_subscription, format='json')
expected_data = {
'status': 400,
'detail': 'clientId, clientPassword and tokenEndpoint'
- ' required for OAUTH2_CLIENT_CREDENTIALS',
+ ' required for OAUTH2_CLIENT_CREDENTIALS'
}
response = self.client.post("/api/nsd/v1/subscriptions",
data=dummy_subscription, format='json')
expected_data = {
'status': 400,
'detail': 'Notification Filter should contain'
- ' either nsdId or nsdInfoId',
+ ' either nsdId or nsdInfoId'
}
response = self.client.post("/api/nsd/v1/subscriptions",
data=dummy_subscription, format='json')
expected_data = {
'status': 400,
'detail': 'Notification Filter should contain'
- ' either pnfdId or pnfdInfoIds',
+ ' either pnfdId or pnfdInfoIds'
}
response = self.client.post("/api/nsd/v1/subscriptions",
data=dummy_subscription, format='json')
expected_data = {
"status": 404,
"detail": "Subscription(" + self.subscription_id + ") "
- "doesn't exists"
+ "doesn't exists"
}
response = self.client.get('/api/nsd/v1/'
'subscriptions/' + self.subscription_id,