-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add rootuser model to models.py (#77)
* make root user and the test for the model students * Delete 0002_mainuser_student.py
- Loading branch information
1 parent
1fe9278
commit 6170e9c
Showing
7 changed files
with
43 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
from django.urls import path | ||
from .views import EventDetail, EventList# type: ignore | ||
from .views import EventDetail, EventList, MainList | ||
|
||
app_name = 'api' | ||
|
||
urlpatterns = [ | ||
path('<int:pk>/', EventDetail.as_view(), name='detail'), | ||
path('', EventList.as_view(), name='list'), | ||
path('mainlist/', MainList.as_view(), name='detail'), | ||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,11 +42,15 @@ def test_event_content(self): | |
self.assertEqual(str(category), 'django') | ||
|
||
def test_student(self): | ||
test_user = Student.objects.create(first_name='Robera',last_name='Melaek',email='[email protected]') | ||
test_user = Student.objects.create(first_name='Robera',last_name='Melaek',username='Melaek',password='Password',email='[email protected]',jnumber=1,role='student') | ||
username = Student.objects.get(id=1) | ||
assert(username.first_name,'Robera') | ||
|
||
|
||
|
||
self.assertEqual(f'{username.username}','Melaek') | ||
self.assertEqual(f'{username.last_name}','Melaek') | ||
self.assertEqual(f'{username.password}','Password') | ||
self.assertEqual(f'{username.jnumber}','1') | ||
self.assertEqual(f'{username.role}','student') | ||
self.assertEqual(f'{username.email}','[email protected]') | ||
self.assertEqual(f'{username.first_name}','Robera') | ||
self.assertEqual(f'{username.student_id}','1') | ||
|
||
|