Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(9)  |  Derive(0)  |  Import(0)

src/d/j/django-notifications-sitewide-HEAD/notifications/context_processors.py   django-notifications-sitewide(Download)
 
            try:
                notification = Notification.objects.get(show_this_message=True)
            except (Notification.DoesNotExist, Notification.MultipleObjectsReturned):
                notification = None

src/d/j/django-notifications-sitewide-HEAD/notifications/tests.py   django-notifications-sitewide(Download)
 
        # Update notification_1
        notification_1 = Notification.objects.get(id=notification_1.id)
 
        self.assertIsNone(notification_1.shown_since_as_timestamp)
        self.assertIsNotNone(timestamp_after_first_edit)
 
        notification = Notification.objects.get(id=notification.id)
        notification.save()
 
        notification = Notification.objects.get(id=notification.id)
        self.assertEqual(timestamp_after_first_edit, notification.shown_since_as_timestamp)
 
        notification = Notification.objects.get(id=notification.id)
        time.sleep(1)
 
        notification = Notification.objects.get(id=notification.id)
        notification.show_this_message = True
        notification.save()

src/d/j/django-notifications-HEAD/notifications/tests.py   django-notifications(Download)
    def test_use_timezone(self):
        from_user = User.objects.create(username="from", password="pwd", email="example@example.com")
        to_user = User.objects.create(username="to", password="pwd", email="example@example.com")
        notify.send(from_user, recipient=to_user, verb='commented', action_object=from_user)
        notification = Notification.objects.get(recipient=to_user)
    def test_disable_timezone(self):
        from_user = User.objects.create(username="from2", password="pwd", email="example@example.com")
        to_user = User.objects.create(username="to2", password="pwd", email="example@example.com")
        notify.send(from_user, recipient=to_user, verb='commented', action_object=from_user)
        notification = Notification.objects.get(recipient=to_user)