0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-11 15:51:19 +00:00

Remove Ping.body field

This commit is contained in:
Pēteris Caune 2024-07-11 16:34:18 +03:00
parent 997154e3b0
commit 3e5080d9eb
No known key found for this signature in database
GPG key ID: E28D7679E9A9EDE2
4 changed files with 20 additions and 4 deletions

View file

@ -0,0 +1,17 @@
# Generated by Django 5.0.7 on 2024-07-11 13:27
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0108_move_body_to_body_raw'),
]
operations = [
migrations.RemoveField(
model_name='ping',
name='body',
),
]

View file

@ -635,7 +635,6 @@ class Ping(models.Model):
remote_addr = models.GenericIPAddressField(blank=True, null=True)
method = models.CharField(max_length=10, blank=True)
ua = models.CharField(max_length=200, blank=True)
body = models.TextField(blank=True, null=True)
body_raw = models.BinaryField(null=True)
object_size = models.IntegerField(null=True)
exitstatus = models.SmallIntegerField(null=True)

View file

@ -36,7 +36,7 @@ class PingBodyTestCase(BaseTestCase):
self.assertEqual(r.status_code, 404)
def test_it_allows_cross_team_access(self) -> None:
Ping.objects.create(owner=self.check, body="this is body")
Ping.objects.create(owner=self.check)
self.client.login(username="bob@example.org", password="password")
r = self.client.get(self.url)

View file

@ -70,7 +70,7 @@ class PingDetailsTestCase(BaseTestCase):
self.assertContains(r, "5 min 0 sec", status_code=200)
def test_it_requires_logged_in_user(self) -> None:
Ping.objects.create(owner=self.check, n=1, body="this is body")
Ping.objects.create(owner=self.check, n=1)
r = self.client.get(self.url)
self.assertRedirects(r, "/accounts/login/?next=" + self.url)
@ -124,7 +124,7 @@ class PingDetailsTestCase(BaseTestCase):
self.assertContains(r, "bar-456", status_code=200)
def test_it_allows_cross_team_access(self) -> None:
Ping.objects.create(owner=self.check, n=1, body="this is body")
Ping.objects.create(owner=self.check, n=1)
self.client.login(username="bob@example.org", password="password")
r = self.client.get(self.url)