Fakultas Ilmu Komputer UI

Commit 81500b86 authored by Putu Agastya's avatar Putu Agastya
Browse files

Merge branch 'staging' into PBI-6-Halaman_Katalog

parents 0af12bd8 fa101c82
......@@ -11,6 +11,8 @@ local_settings.py
db.sqlite3
db.sqlite3-journal
media
*/__pycache__/*
static/
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
# in your Git repository. Update and uncomment the following line accordingly.
......@@ -185,6 +187,7 @@ pip-selfcheck.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.vscode/
### VisualStudioCode Patch ###
# Ignore all local history of files
......
{
"python.pythonPath": "env\\Scripts\\python.exe"
}
\ No newline at end of file
......@@ -15,3 +15,28 @@ class DaftarKatalogTest(TestCase):
def test_daftar_katalog_using_daftar_katalog_func(self):
found = resolve('/')
self.assertEqual(found.func.__name__, DaftarKatalog.as_view().__name__)
class TemplateLoaderTest(TestCase):
def test_template_loader_url_exist(self):
url = "/test-page.html"
response = Client().get(url)
self.assertEqual(response.status_code,200)
def test_template_loader_using_template_loader_template(self):
url = "/test-page.html"
response = Client().get(url)
expected_template_name = "test-page.html"
self.assertTemplateUsed(response, expected_template_name)
def test_template_loader_using_template_loader_func(self):
url = "/test-page.html"
found = resolve(url)
expected_view_name = "pages"
self.assertEqual(found.func.__name__, expected_view_name)
def test_template_loader_handle_non_existent_html(self):
url = "/test.html"
expected_template_name = "error-404.html"
response = Client().get(url)
self.assertEqual(response.status_code,200)
self.assertTemplateUsed(response, expected_template_name)
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class AuthenticationConfig(AppConfig):
name = 'authentication'
# Generated by Django 3.0.3 on 2020-04-06 18:50
import authentication.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('name', models.CharField(max_length=150)),
('is_admin', models.BooleanField(default=False)),
('is_contributor', models.BooleanField(default=False)),
('instansi', models.CharField(max_length=240)),
('nik', models.CharField(max_length=240)),
('alamat', models.CharField(max_length=240)),
('nomor_telpon', models.CharField(max_length=240)),
('email', models.EmailField(max_length=254, unique=True)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
'abstract': False,
},
managers=[
('objects', authentication.models.CustomUserManager()),
],
),
]
# Generated by Django 3.0.3 on 2020-04-06 19:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='username',
field=models.CharField(blank=True, default='', max_length=150),
),
]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment