Fakultas Ilmu Komputer UI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kape
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PMPL
Class Project
Kape
Commits
74974f8a
Commit
74974f8a
authored
5 years ago
by
Muhammad Ilham Peruzzi
Browse files
Options
Downloads
Patches
Plain Diff
add test case to test account serializers
parent
a6e57223
No related branches found
No related tags found
1 merge request
!283
1606823475-175
Pipeline
#26850
passed
5 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/tests/test_account_serializers.py
+19
-0
19 additions, 0 deletions
core/tests/test_account_serializers.py
with
19 additions
and
0 deletions
core/tests/test_account_serializers.py
0 → 100644
+
19
−
0
View file @
74974f8a
from
django.test
import
TestCase
from
django.contrib.auth.models
import
User
from
core.models.accounts
import
Company
,
Student
,
Supervisor
from
core.serializers.accounts
import
StudentSerializer
import
datetime
class
TestAccountSerializers
(
TestCase
):
def
test_accepted_no
(
self
):
user
=
User
.
objects
.
create_user
(
'
dummy.login.student
'
,
'
dummy.login.student@student.com
'
,
'
lalala123
'
)
student
=
Student
.
objects
.
create
(
user
=
user
,
npm
=
1606837631
,
resume
=
None
,
sertifikat
=
None
,
phone_number
=
"
081291693790
"
,
gender
=
"
laki-laki
"
,
birth_place
=
"
Jakarta
"
,
birth_date
=
datetime
.
datetime
.
now
())
self
.
assertEqual
(
StudentSerializer
.
get_accepted_no
(
student
),
0
)
def
test_read_no
(
self
):
user
=
User
.
objects
.
create_user
(
'
dummy.login.student
'
,
'
dummy.login.student@student.com
'
,
'
lalala123
'
)
student
=
Student
.
objects
.
create
(
user
=
user
,
npm
=
1606837631
,
resume
=
None
,
sertifikat
=
None
,
phone_number
=
"
081291693790
"
,
gender
=
"
laki-laki
"
,
birth_place
=
"
Jakarta
"
,
birth_date
=
datetime
.
datetime
.
now
())
self
.
assertEqual
(
StudentSerializer
.
get_read_no
(
student
),
0
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment