Browse Source

Django==2.2, pytz==2019.1

pull/241/head
Pēteris Caune 6 years ago
parent
commit
12f8ffcd80
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 5 additions and 6 deletions
  1. +3
    -4
      hc/front/tests/test_cron_preview.py
  2. +2
    -2
      requirements.txt

+ 3
- 4
hc/front/tests/test_cron_preview.py View File

@ -16,8 +16,7 @@ class CronPreviewTestCase(BaseTestCase):
self.assertContains(r, "cron-preview-title", status_code=200) self.assertContains(r, "cron-preview-title", status_code=200)
def test_it_rejects_invalid_cron_expression(self): def test_it_rejects_invalid_cron_expression(self):
samples = [None,
"",
samples = ["",
"*", "*",
"100 100 100 100 100", "100 100 100 100 100",
"* * * * * *", "* * * * * *",
@ -29,14 +28,14 @@ class CronPreviewTestCase(BaseTestCase):
self.assertContains(r, "Invalid cron expression", status_code=200) self.assertContains(r, "Invalid cron expression", status_code=200)
def test_it_handles_invalid_timezone(self): def test_it_handles_invalid_timezone(self):
for tz in [None, "", "not-a-timezone"]:
for tz in ["", "not-a-timezone"]:
payload = {"schedule": "* * * * *", "tz": tz} payload = {"schedule": "* * * * *", "tz": tz}
r = self.client.post("/checks/cron_preview/", payload) r = self.client.post("/checks/cron_preview/", payload)
self.assertContains(r, "Invalid timezone", status_code=200) self.assertContains(r, "Invalid timezone", status_code=200)
def test_it_handles_missing_arguments(self): def test_it_handles_missing_arguments(self):
r = self.client.post("/checks/cron_preview/", {}) r = self.client.post("/checks/cron_preview/", {})
self.assertContains(r, "Invalid cron expression", status_code=200)
self.assertContains(r, "Invalid timezone", status_code=200)
def test_it_rejects_get(self): def test_it_rejects_get(self):
r = self.client.get("/checks/cron_preview/", {}) r = self.client.get("/checks/cron_preview/", {})


+ 2
- 2
requirements.txt View File

@ -1,6 +1,6 @@
croniter==0.3.29 croniter==0.3.29
Django==2.1.7
Django==2.2
django_compressor==2.2 django_compressor==2.2
psycopg2==2.7.5 psycopg2==2.7.5
pytz==2018.7
pytz==2019.1
requests==2.20.1 requests==2.20.1

Loading…
Cancel
Save