./manage.py behave --keepdb
Using existing test database for alias 'default'...
Feature: HomePage # features/homepage.feature:1
Scenario: # features/homepage.feature:2
Given the homepage loads # features/steps/homepage.py:4 1.613s
Then it should have the "apply-now" link and say "Apply now" # features/steps/homepage.py:9 0.218s
And it should have the "learn-more" link and say "Learn more" # features/steps/homepage.py:9 0.198s
And "learn-more" should deeplink to "#learn_more_section" # None
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from intake import models | |
import Levenshtein | |
from rest_framework import serializers | |
from .fields import FormattedLocalDateField | |
from intake.services import status_notifications as StatusNotificationsService | |
class StatusNotificationAnalysisSerializer(serializers.ModelSerializer): | |
contact_info = serializers.SerializerMethodField() | |
message_change = serializers.SerializerMethodField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<style> | |
body { | |
margin: 0; padding: 0; | |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif; | |
} | |
main { | |
padding: 1em 2em; | |
} | |
.day-row > td:first-child { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class TransferPartnershipManager(models.Manager): | |
def get_by_natural_key(self, from_name, to_name): | |
return self.get( | |
from_organization__name=from_name, | |
to_organization__name=to_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HumbleCachedContext: | |
"""Only pulls what it needs, and never pulls twice | |
""" | |
def __init__(self, **context_items): | |
self.get_functions = {} | |
for key, value in context_items: | |
self.add(key, value) |
commit 1b3276d2271518ef0e5bc5d5083fa029b101fb14
Before this refactor, the Organization
model had a method, get_transfer_org
which hardcoded the transfer capability between organizations.
# in user_accounts/models/organization.py
def get_transfer_org(self):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.assertAlmostEqual() | |
self.assertAlmostEquals() | |
self.assertContains() | |
self.assertCountEqual() | |
self.assertDictContainsSubset() | |
self.assertDictEqual() | |
self.assertEqual() | |
self.assertEquals() | |
self.assertFalse() | |
self.assertFieldOutput() |
# in intake.models
class FormSubmission(models.Model):
organizations = models.ManyToManyField('user_accounts.Organization')
# in user_accounts.models
class Organization(models.Model):
# some attributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
import ipdb; ipdb.set_trace() | |
]]></content> | |
<tabTrigger>ipd</tabTrigger> | |
<scope>source.python</scope> | |
<description>import ipdb; ipdb.set_trace()</description> | |
</snippet> |