diff --git a/.github/workflows/python_syntax_check.yml b/.github/workflows/python_syntax_check.yml index 43eedeab..32d038af 100644 --- a/.github/workflows/python_syntax_check.yml +++ b/.github/workflows/python_syntax_check.yml @@ -19,4 +19,4 @@ jobs: - run: pytest --doctest-modules . || true - run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true - run: safety check - - run: python manage.py test + diff --git a/.github/workflows/testcases.yml b/.github/workflows/testcases.yml index 20fbc652..42e377b1 100644 --- a/.github/workflows/testcases.yml +++ b/.github/workflows/testcases.yml @@ -1,25 +1,11 @@ -# name: Testcases check - -# on: [push] - -# # defaults: -# # run: -# # working-directory: user - -# jobs: -# build: -# runs-on: ubuntu-latest -# strategy: -# matrix: -# python-version: ["3.8", "3.9", "3.10"] -# steps: - -# - name: Checkout repository -# uses: actions/checkout@v2 - -# - name: Test the features -# run: | -# pwd -# python manage.py test - - +name: run test cases +on: [pull_request, push] +jobs: + test_python: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: actions/checkout@v3 + - run: pip install -r requirements.txt || true + - run: python manage.py test \ No newline at end of file diff --git a/publish/tests/test_db.py b/publish/tests/test_db.py deleted file mode 100644 index 41dca322..00000000 --- a/publish/tests/test_db.py +++ /dev/null @@ -1,48 +0,0 @@ -from utils import get_client -from django.http import HttpResponse -from publish.views import ridesDB - -from django.test import SimpleTestCase - -class Testdb(SimpleTestCase): - global id - - def test_insert_db(self): - - data = { - 'name':"CSC510-wed", - 'destination':"James Hunt Library", - 'date': "2022-10-10", - 'hour':"10", - 'minute':"00", - 'ampm':"AM", - 'details': "Ride to attend Monday CSC510 Lecture on 10/10/2022 at 10:15 AM."} - - id = ridesDB.insert_one(data).inserted_id - self.assertEqual(ridesDB.insert_one(data), True) - - result = ridesDB.find_one({'_id': id}) - print("res is", result) - self.assertEqual(result['_id'], id) - - ridesDB.delete_one({'_id': id}) - - - - - # def test_find_db(self): - # # id = self.test_insert_db() - # result= ridesDB.find_one({'_id':id}) - # print("res is",result) - # self.assertEqual(result['_id'], id) - # - # def test_delete_db(self): - # # id = self.test_insert_db() - # ridesDB.delete_one({'_id':id}) - - - - - - - diff --git a/user/tests/test_db.py b/user/tests/test_db.py deleted file mode 100644 index 1be476c6..00000000 --- a/user/tests/test_db.py +++ /dev/null @@ -1,37 +0,0 @@ -from utils import get_client -from django.http import HttpResponse -from user.views import userDB - -from django.test import SimpleTestCase - -class Testdb(SimpleTestCase): - - - - def test_insert_db(self): - - data = {"username": "John", - "unityid" : "jdwyer", - "fname" : "John", - "lname" : "Dwyer", - "email" : "jdwyer@ncsu.edu", - "password" : "jd45678", - "phone" : "987657890"} - - id = userDB.insert_one(data).inserted_id - result = userDB.find_one({'_id': id}) - print("res is", result) - self.assertEqual(result['_id'], id) - userDB.delete_one({'_id': id}) - # self.assertEqual(userDB.insert_one(data),True) - - # def test_find_db(self): - # id = self.test_insert_db() - # result= userDB.find_one({'_id':id}) - # print("res is",result) - # self.assertEqual(result['_id'], id) - # - # def test_delete_db(self): - # id = self.test_insert_db() - # userDB.delete_one({'_id':id}) -