added django tasks

This commit is contained in:
karthikmurakonda 2023-10-11 03:51:24 +05:30
parent 186bab832c
commit 6a677e931a
6 changed files with 34 additions and 8 deletions

30
.github/workflows/django.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Django CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: |
python manage.py test

1
.gitignore vendored
View File

@ -129,7 +129,6 @@ dmypy.json
/venv/
/.github/
./CDC_Backend/static
./CDC_Backend/Storage
/CDC_Backend/CDC_Backend/__pycache__/

View File

@ -18,7 +18,7 @@ class AdminView(APITestCase):
self.s_admin = User.objects.create(email=str(os.environ.get(
"s_email")), id=generateRandomString(), user_type=["s_admin"])
self.user1 = User.objects.create(
email="200010030@iitdh.ac.in", id="200010030", user_type=[STUDENT])
email="200010032@iitdh.ac.in", id="200010032", user_type=[STUDENT])
self.user2 = User.objects.create(
email="200010038@iitdh.ac.in", id="200010038", user_type=[STUDENT])
self.user3 = User.objects.create(
@ -26,7 +26,7 @@ class AdminView(APITestCase):
self.user4 = User.objects.create(
email="200030058@iitdh.ac.in", id="200030058", user_type=[STUDENT])
self.student1 = Student.objects.create(
name='John Doe', roll_no='200010030', batch='2020', branch='CSE', cpi=9.5, id="200010030", can_apply=True, resumes=["8BSLybntULgrPPm_beehyv.pdf", "8BSLybntULgrPPm_kalera.pdf"], can_apply_internship=True)
name='John Doe', roll_no='200010032', batch='2020', branch='CSE', cpi=9.5, id="200010032", can_apply=True, resumes=["8BSLybntULgrPPm_beehyv.pdf", "8BSLybntULgrPPm_kalera.pdf"], can_apply_internship=True)
self.student2 = Student.objects.create(
name='Jane Doe', roll_no='200010038', batch='2020', branch='EE', cpi=9.0, id="200010038", can_apply=True, resumes=["8BSLybntULgrPPm_beehyv.pdf"], can_apply_internship=True)
self.student3 = Student.objects.create(
@ -84,8 +84,8 @@ class AdminView(APITestCase):
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.token = response.data['id_token']
# TODO: logic Issue Fix The Above Function
# def test_get_stats(self):
# self.pa1.selected = True
# self.pa1.save()
@ -187,7 +187,6 @@ class AdminView(APITestCase):
# self.assertEqual(
# student4_stats['second_offer_compensation'], None)
# logic Issue Fix The Above Function
def test_addPPO(self): # done
url = reverse("Add PPO")

View File

@ -16,7 +16,7 @@ class StudentViewsTestCase(APITestCase):
self.client = APIClient()
self.user = User.objects.create(
email=str(os.environ.get("email")),
id="200010052",
id=str(os.environ.get("roll_no")),
user_type=[STUDENT])
self.assertEqual(
self.user.email, User.objects.get(id=self.user.id).email)

View File

@ -8,5 +8,4 @@ urlpatterns = [
path('student/', include(studentUrls)),
path('company/', include(companyUrls)),
path('admin/', include(adminUrls)),
]

View File

@ -4,5 +4,4 @@ from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('APIs.urls')),
path('internapi/', include('internAPIs.urls'))
]