Fakultas Ilmu Komputer UI

Commit c377c60e authored by Saul Andre's avatar Saul Andre
Browse files

[REFACTOR] add static files to storages

parent e6e4df73
......@@ -14,10 +14,7 @@
<title>Unggah Materi</title>
<!-- Custom fonts for this template -->
<<<<<<< HEAD
<link rel="icon" type="image/png" href="{% static 'images/icons/logo.ico' %}" />
=======
>>>>>>> bbe371fd4c3a98864a1537c2c6e0e7104a8e1af7
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<!-- Custom styles for this template -->
......@@ -49,7 +46,6 @@
<!-- Nav Item - Dashboard -->
<li class="nav-item">
<<<<<<< HEAD
<a class="nav-link" href="{% url 'unggah' %}">
<span>Unggah Materi</span>
</a>
......@@ -65,15 +61,6 @@
<a class="nav-link" href="#">
<span>Statisik Materi</span>
</a>
=======
<a class="nav-link" href="{% url 'dashboard' %}">
<span>Beranda</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'unggah' %}">
<span>Unggah Materi</span></a>
>>>>>>> bbe371fd4c3a98864a1537c2c6e0e7104a8e1af7
</li>
</ul>
......@@ -99,13 +86,8 @@
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<<<<<<< HEAD
<a class="nav-link" href="/dashboard/">
<span class="mr-2 d-none d-lg-inline text-gray-600 small">Dasbor</span>
=======
<a class="nav-link" href="/unggah/">
<span class="mr-2 d-none d-lg-inline text-gray-600 small">Unggah</span>
>>>>>>> bbe371fd4c3a98864a1537c2c6e0e7104a8e1af7
</a>
</li>
......@@ -127,15 +109,9 @@
<li class="nav-item dropdown no-arrow">
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<<<<<<< HEAD
<span class="mr-2 d-none d-lg-inline text-gray-600 small">{{ user.name }}</span>
<img class="img-profile rounded-circle"
src="{{ user.profile_picture.url }}">
=======
<span class="mr-2 d-none d-lg-inline text-gray-600 small">Admin</span>
<img class="img-profile rounded-circle"
src="https://source.unsplash.com/QAB-WJcbgJk/60x60">
>>>>>>> bbe371fd4c3a98864a1537c2c6e0e7104a8e1af7
</a>
</li>
......@@ -151,7 +127,6 @@
<div class="col-20">
<h1 class="mt-2">Upload Materi</h1>
<hr class="mt-0 mb-4">
<<<<<<< HEAD
{% if messages %}
{% for message in messages %}
{% if message.level == DEFAULT_MESSAGE_LEVELS.SUCCESS %}
......@@ -166,17 +141,6 @@
{% endif %}
{% endfor %}
{% endif %}
<form form id="add_form" method="POST" action="" novalidate enctype="multipart/form-data">
{% csrf_token %}
{% for field in form %}
<div class="col-md-6">
<div class="fieldWrapper">
{{ field.label_tag }} {{ field }}
<p> </p>
{{ field.errors }}
<p> </p>
=======
<form form id="add_form" method="POST" action="" novalidate enctype="multipart/form-data">
{% csrf_token %}
{% for field in form%}
......@@ -184,7 +148,6 @@
<div class="fieldWrapper">
{{ field.label_tag }} {{ field }}
{{ field.errors }}
>>>>>>> bbe371fd4c3a98864a1537c2c6e0e7104a8e1af7
{% if field.help_text %}
<p class="help">{{ field.help_text|safe }}</p>
{% endif %}
......
......@@ -2,13 +2,9 @@ import json
from django.contrib.auth import get_user_model
from django.core import serializers
<<<<<<< HEAD
from django.core.files import File
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import Client, RequestFactory, TestCase
=======
from django.test import Client, TestCase, RequestFactory
>>>>>>> bbe371fd4c3a98864a1537c2c6e0e7104a8e1af7
from django.urls import resolve
from administration.utils import id_generator
......@@ -51,7 +47,6 @@ class DaftarKatalogTest(TestCase):
class DetailMateriTest(TestCase):
<<<<<<< HEAD
def setUp(self):
self.client = Client()
self.admin_credential = {
......@@ -91,8 +86,6 @@ class DetailMateriTest(TestCase):
def test_detail_materi_using_detail_materi_template(self):
response = Client().get(self.url)
self.assertTemplateUsed(response, 'app/detail_materi.html')
=======
>>>>>>> bbe371fd4c3a98864a1537c2c6e0e7104a8e1af7
def test_detail_materi_using_detail_materi_func(self):
found = resolve(self.url)
......@@ -196,17 +189,12 @@ class TemplateLoaderTest(TestCase):
class UploadPageTest(TestCase):
def setUp(self):
<<<<<<< HEAD
self.client = Client()
=======
self.client=Client()
>>>>>>> bbe371fd4c3a98864a1537c2c6e0e7104a8e1af7
self.user = User.objects._create_user(email="kontributor@gov.id",
password="kontributor", is_contributor=True)
def test_upload_page_using_login_func(self):
found = resolve("/unggah/")
<<<<<<< HEAD
self.assertEqual(found.func.__name__,
UploadMateriView.as_view().__name__)
......@@ -220,31 +208,13 @@ class UploadPageTest(TestCase):
# Negative tests
self.client.login(email="kontributor@gov.id",
password="kontributor")
=======
self.assertEqual(found.func.__name__, UploadMateriView.as_view().__name__)
def test_uplaod_page_url_is_exist(self):
#Positive test
self.client.login(email="kontributor@gov.id",
password="kontributor")
response = self.client.get("/unggah/")
self.assertEqual(response.status_code,200)
# Negative tests
self.client.login(email="kontributor@gov.id",
password="kontributor")
>>>>>>> bbe371fd4c3a98864a1537c2c6e0e7104a8e1af7
response = Client().get("/fake/")
self.assertEqual(response.status_code, 404)
def test_upload_page_template(self):
url = "/unggah/"
self.client.login(email="kontributor@gov.id",
<<<<<<< HEAD
password="kontributor")
=======
password="kontributor")
>>>>>>> bbe371fd4c3a98864a1537c2c6e0e7104a8e1af7
response = self.client.get(url)
expected_template_name = "unggah.html"
self.assertTemplateUsed(response, expected_template_name)
......
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