From 0530e6cd46370fabc40c4b3c8a7c820a0e6f5ac1 Mon Sep 17 00:00:00 2001 From: shimilgithub Date: Wed, 6 Sep 2023 14:24:53 +0530 Subject: [PATCH] removing unique key constraint from parascriptural --- app/db_models.py | 1 - app/test/test_parascripturals.py | 28 ++++++++++++++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/db_models.py b/app/db_models.py index 6a18940f..90dbbd4e 100644 --- a/app/db_models.py +++ b/app/db_models.py @@ -184,7 +184,6 @@ class Parascriptural():# pylint: disable=too-few-public-methods createTime = Column('created_at', DateTime, default=ist_time) updateTime = Column('last_updated_at', DateTime, onupdate= ist_time,default=ist_time) __table_args__ = ( - UniqueConstraint('category', 'title'), {'extend_existing': True} ) class SignBibleVideo():# pylint: disable=too-few-public-methods diff --git a/app/test/test_parascripturals.py b/app/test/test_parascripturals.py index 44e12844..2f57c5e0 100644 --- a/app/test/test_parascripturals.py +++ b/app/test/test_parascripturals.py @@ -72,20 +72,20 @@ def test_post_default(): assert len(data) == len(response.json()['data']) return response,resource_name -def test_post_duplicate(): - '''Negative test to add two parascripturals Links with same type and title''' - data = [ - {'category':'Bible Stories', 'title':"the Gods reveals himself in new testament", - "link":"http://somewhere.com/new"} - ] - resp, resource_name = check_post(data) - assert resp.status_code == 201 - assert resp.json()['message'] == "Parascripturals added successfully" - - data[0]['link'] = 'http://anotherplace/item' - response = client.post(UNIT_URL+resource_name, headers=headers_auth, json=data) - assert response.status_code == 409 - assert response.json()['error'] == "Already Exists" +# def test_post_duplicate(): +# '''Negative test to add two parascripturals Links with same type and title''' +# data = [ +# {'category':'Bible Stories', 'title':"the Gods reveals himself in new testament", +# "link":"http://somewhere.com/new"} +# ] +# resp, resource_name = check_post(data) +# assert resp.status_code == 201 +# assert resp.json()['message'] == "Parascripturals added successfully" + +# data[0]['link'] = 'http://anotherplace/item' +# response = client.post(UNIT_URL+resource_name, headers=headers_auth, json=data) +# assert response.status_code == 409 +# assert response.json()['error'] == "Already Exists" def test_post_incorrect_data(): ''' tests to check input validation in post API'''