mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix bug where compound foreign keys produced broken links, closes #1098
This commit is contained in:
parent
e800ffcf7c
commit
deb0be4ae5
6 changed files with 88 additions and 29 deletions
|
|
@ -804,12 +804,16 @@ def test_table_html_foreign_key_links(app_client):
|
|||
'<td class="col-foreign_key_with_label type-str"><a href="/fixtures/simple_primary_key/1">hello</a>\xa0<em>1</em></td>',
|
||||
'<td class="col-foreign_key_with_blank_label type-str"><a href="/fixtures/simple_primary_key/3">-</a>\xa0<em>3</em></td>',
|
||||
'<td class="col-foreign_key_with_no_label type-str"><a href="/fixtures/primary_key_multiple_columns/1">1</a></td>',
|
||||
'<td class="col-foreign_key_compound_pk1 type-str">a</td>',
|
||||
'<td class="col-foreign_key_compound_pk2 type-str">b</td>',
|
||||
],
|
||||
[
|
||||
'<td class="col-pk type-pk"><a href="/fixtures/foreign_key_references/2">2</a></td>',
|
||||
'<td class="col-foreign_key_with_label type-none">\xa0</td>',
|
||||
'<td class="col-foreign_key_with_blank_label type-none">\xa0</td>',
|
||||
'<td class="col-foreign_key_with_no_label type-none">\xa0</td>',
|
||||
'<td class="col-foreign_key_compound_pk1 type-none">\xa0</td>',
|
||||
'<td class="col-foreign_key_compound_pk2 type-none">\xa0</td>',
|
||||
],
|
||||
]
|
||||
|
||||
|
|
@ -836,6 +840,8 @@ def test_table_html_disable_foreign_key_links_with_labels(app_client):
|
|||
'<td class="col-foreign_key_with_label type-str">1</td>',
|
||||
'<td class="col-foreign_key_with_blank_label type-str">3</td>',
|
||||
'<td class="col-foreign_key_with_no_label type-str">1</td>',
|
||||
'<td class="col-foreign_key_compound_pk1 type-str">a</td>',
|
||||
'<td class="col-foreign_key_compound_pk2 type-str">b</td>',
|
||||
]
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue