Skip to content

Commit 76ea454

Browse files
committed
add testcase for datetime props
1 parent 2c17c90 commit 76ea454

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from datetime import datetime
2+
from django.utils import timezone
3+
from django_unicorn.components import UnicornView
4+
5+
class TestDatetimeView(UnicornView):
6+
dt: datetime = None
7+
8+
def mount(self):
9+
self.dt = timezone.now()
10+
11+
def foo(self):
12+
pass
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% load unicorn %}
2+
<div>
3+
<div style="width:200px;height:200px;margin:10px;background-color:#aaffaa" unicorn:click="foo()">
4+
{{ dt }}<br>
5+
(click me)
6+
</div>
7+
</div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% extends "www/base.html" %}
2+
{% load static unicorn %}
3+
4+
{% block content %}
5+
6+
<h2>Test Datetime</h2>
7+
8+
{% unicorn 'test-datetime' %}
9+
10+
{% endblock content %}

0 commit comments

Comments
 (0)