@ -0,0 +1,23 @@ | |||||
# Generated by Django 2.2.6 on 2019-11-19 13:46 | |||||
from django.db import migrations, models | |||||
class Migration(migrations.Migration): | |||||
dependencies = [ | |||||
('accounts', '0027_profile_deletion_notice_date'), | |||||
] | |||||
operations = [ | |||||
migrations.AddField( | |||||
model_name='profile', | |||||
name='last_active_date', | |||||
field=models.DateTimeField(blank=True, null=True), | |||||
), | |||||
migrations.AlterField( | |||||
model_name='profile', | |||||
name='sms_limit', | |||||
field=models.IntegerField(default=5), | |||||
), | |||||
] |
@ -0,0 +1,18 @@ | |||||
# Generated by Django 2.2.6 on 2019-11-19 13:46 | |||||
from django.db import migrations, models | |||||
class Migration(migrations.Migration): | |||||
dependencies = [ | |||||
('api', '0063_auto_20190903_0901'), | |||||
] | |||||
operations = [ | |||||
migrations.AlterField( | |||||
model_name='channel', | |||||
name='kind', | |||||
field=models.CharField(choices=[('email', 'Email'), ('webhook', 'Webhook'), ('hipchat', 'HipChat'), ('slack', 'Slack'), ('pd', 'PagerDuty'), ('pagertree', 'PagerTree'), ('pagerteam', 'Pager Team'), ('po', 'Pushover'), ('pushbullet', 'Pushbullet'), ('opsgenie', 'OpsGenie'), ('victorops', 'VictorOps'), ('discord', 'Discord'), ('telegram', 'Telegram'), ('sms', 'SMS'), ('zendesk', 'Zendesk'), ('trello', 'Trello'), ('matrix', 'Matrix'), ('whatsapp', 'WhatsApp'), ('apprise', 'Apprise'), ('mattermost', 'Mattermost'), ('msteams', 'Microsoft Teams')], max_length=20), | |||||
), | |||||
] |
@ -18,6 +18,22 @@ class MyChecksTestCase(BaseTestCase): | |||||
r = self.client.get(self.url) | r = self.client.get(self.url) | ||||
self.assertContains(r, "Alice Was Here", status_code=200) | self.assertContains(r, "Alice Was Here", status_code=200) | ||||
# last_active_date should have been set | |||||
self.profile.refresh_from_db() | |||||
self.assertTrue(self.profile.last_active_date) | |||||
def test_it_bumps_last_active_date(self): | |||||
self.profile.last_active_date = timezone.now() - td(days=10) | |||||
self.profile.save() | |||||
self.client.login(username="[email protected]", password="password") | |||||
self.client.get(self.url) | |||||
# last_active_date should have been bumped | |||||
self.profile.refresh_from_db() | |||||
delta = timezone.now() - self.profile.last_active_date | |||||
self.assertTrue(delta.total_seconds() < 1) | |||||
def test_it_updates_current_project(self): | def test_it_updates_current_project(self): | ||||
self.profile.current_project = None | self.profile.current_project = None | ||||
self.profile.save() | self.profile.save() | ||||