New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add URN schemes to variable completions #1067
Changes from 16 commits
4770bd5
843eaa0
3d65d3e
9cd1058
accfad7
6715ca5
c0f081a
976ea56
df7d878
7537899
d8e9d29
a719eb8
1b5fe66
8cb3eb0
943daaa
eab17f6
18b245d
0435ebe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,6 +210,14 @@ def test_send_message_auto_completion_processor(self): | |
# contact fields are included at the end in alphabetical order | ||
self.assertEquals(response.context['completions'], json.dumps(completions)) | ||
|
||
# a Twitter channel | ||
Channel.create(self.org, self.user, None, 'TT') | ||
completions.insert(-2, dict(name="contact.%s" % 'twitter', display="Contact %s" % "Twitter handle")) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the substitution here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
response = self.client.get(outbox_url) | ||
# the Twitter URN scheme is included | ||
self.assertEquals(response.context['completions'], json.dumps(completions)) | ||
|
||
def test_create_outgoing(self): | ||
tel_urn = "tel:250788382382" | ||
tel_contact = Contact.get_or_create(self.org, self.user, urns=[tel_urn]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this will read "Contact Facebook" or "Contact Twitter" ya? Seems we might want something more like "Contact Facebook URN" and "Contact Twitter URN" instead.. Though from a naming perspective that is slightly problematic since these won't be full URNs but just the paths right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we'll get "Contact Facebook identifier" or "Contact Twitter handle"
as seen on
https://github.com/nyaruka/rapidpro/blob/master/temba/contacts/models.py#L61
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok great.