Skip to content

Commit 2cae9ae

Browse files
committed
remove refs to bootstrap3 template folder
1 parent 1ec915d commit 2cae9ae

10 files changed

+81
-72
lines changed

edc_locator/model_mixins/subject_contact_fields_mixin.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ class SubjectContactFieldsMixin(models.Model):
1010
max_length=25,
1111
choices=YES_NO,
1212
verbose_name=format_html(
13-
"Has the participant given permission <b>to contacted by telephone "
14-
"or cell</b> by study staff for follow-up purposes during the study?"
13+
"Has the participant given permission <b>{}</b> "
14+
"by study staff for follow-up purposes during the study?",
15+
"to contacted by telephone or cell",
1516
),
1617
)
1718

@@ -20,7 +21,8 @@ class SubjectContactFieldsMixin(models.Model):
2021
choices=YES_NO,
2122
verbose_name=format_html(
2223
"Has the participant given permission for study "
23-
"staff <b>to make home visits</b> for follow-up purposes?"
24+
"staff <b>{}</b> for follow-up purposes?",
25+
"to make home visits",
2426
),
2527
)
2628

@@ -30,8 +32,9 @@ class SubjectContactFieldsMixin(models.Model):
3032
null=True,
3133
blank=False,
3234
verbose_name=format_html(
33-
"Has the participant given permission <b>to be contacted by SMS</b> "
34-
"by study staff for follow-up purposes during the study?"
35+
"Has the participant given permission <b>{}</b> "
36+
"by study staff for follow-up purposes during the study?",
37+
"to be contacted by SMS",
3538
),
3639
)
3740

edc_locator/model_mixins/subject_indirect_contact_fields_mixin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ class SubjectIndirectContactFieldsMixin(models.Model):
1010
max_length=25,
1111
choices=YES_NO,
1212
verbose_name=format_html(
13-
"Has the participant given permission for study staff "
14-
"<b>to contact anyone else</b> for follow-up purposes during the study?"
13+
"{} <b>{}</b> {}?",
14+
"Has the participant given permission for study staff",
15+
"to contact anyone else",
16+
"for follow-up purposes during the study",
1517
),
1618
help_text="For example a partner, spouse, family member, neighbour ...",
1719
)

edc_locator/model_mixins/subject_work_fields_mixin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ class SubjectWorkFieldsMixin(models.Model):
1010
max_length=25,
1111
choices=YES_NO,
1212
verbose_name=format_html(
13-
"Has the participant given permission to be contacted "
14-
"<b>at work</b>, by telephone or cell, by study staff for follow-up "
15-
"purposes during the study?"
13+
"{} <b>{}</b>, {} ",
14+
"Has the participant given permission to be contacted",
15+
"at work",
16+
"by telephone or cell, by study staff for follow-up purposes during the study?",
1617
),
1718
)
1819

edc_locator/modeladmin_mixins.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def subject(self, obj):
7676
age_in_years=age(born=consent.dob, reference_dt=get_utcnow()).years,
7777
initials=consent.initials,
7878
)
79-
return render_to_string("changelist_locator_subject.html", context=context)
79+
return render_to_string("edc_locator/changelist_locator_subject.html", context=context)
8080

8181
@admin.display(description="Contact Rules", ordering="may_call")
8282
def contact_rules(self, obj):
@@ -89,7 +89,9 @@ def contact_rules(self, obj):
8989
YES=YES,
9090
NO=NO,
9191
)
92-
return render_to_string("changelist_locator_contact_rules.html", context=context)
92+
return render_to_string(
93+
"edc_locator/changelist_locator_contact_rules.html", context=context
94+
)
9395

9496
@admin.display(description="Contacts")
9597
def contacts(self, obj):
@@ -99,4 +101,6 @@ def contacts(self, obj):
99101
subject_phone=obj.subject_phone,
100102
subject_phone_alt=obj.subject_phone_alt,
101103
)
102-
return render_to_string("changelist_locator_contacts.html", context=context)
104+
return render_to_string(
105+
"edc_locator/changelist_locator_contacts.html", context=context
106+
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

edc_locator/tests/test_settings.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import sys
2+
from pathlib import Path
3+
4+
from edc_test_settings.default_test_settings import DefaultTestSettings
5+
6+
app_name = "edc_locator"
7+
base_dir = Path(__file__).parent.parent.parent
8+
print(base_dir)
9+
10+
project_settings = DefaultTestSettings(
11+
calling_file=__file__,
12+
template_dirs=[str(base_dir / app_name / "tests" / "templates")],
13+
BASE_DIR=base_dir,
14+
APP_NAME=app_name,
15+
ETC_DIR=str(base_dir / app_name / "tests" / "etc"),
16+
SILENCED_SYSTEM_CHECKS=[
17+
"sites.E101",
18+
"edc_navbar.E002",
19+
"edc_navbar.E003",
20+
"edc_consent.E001",
21+
],
22+
SUBJECT_VISIT_MODEL="edc_visit_tracking.subjectvisit",
23+
EDC_SITES_REGISTER_DEFAULT=True,
24+
INSTALLED_APPS=[
25+
"django.contrib.admin",
26+
"django.contrib.auth",
27+
"django.contrib.contenttypes",
28+
"django.contrib.sessions",
29+
"django.contrib.messages",
30+
"django.contrib.staticfiles",
31+
"django.contrib.sites",
32+
"simple_history",
33+
"django_crypto_fields.apps.AppConfig",
34+
"edc_action_item.apps.AppConfig",
35+
"edc_appointment.apps.AppConfig",
36+
"edc_auth.apps.AppConfig",
37+
"edc_data_manager.apps.AppConfig",
38+
"edc_device.apps.AppConfig",
39+
"edc_form_runners.apps.AppConfig",
40+
"edc_identifier.apps.AppConfig",
41+
"edc_lab.apps.AppConfig",
42+
"edc_label.apps.AppConfig",
43+
"edc_locator.apps.AppConfig",
44+
"edc_metadata.apps.AppConfig",
45+
"edc_notification.apps.AppConfig",
46+
"edc_registration.apps.AppConfig",
47+
"edc_sites.apps.AppConfig",
48+
"edc_visit_schedule.apps.AppConfig",
49+
"edc_visit_tracking.apps.AppConfig",
50+
"edc_appconfig.apps.AppConfig",
51+
],
52+
add_dashboard_middleware=True,
53+
).settings
54+
55+
for k, v in project_settings.items():
56+
setattr(sys.modules[__name__], k, v)

runtests.py

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,5 @@
11
#!/usr/bin/env python
2-
import logging
3-
from pathlib import Path
4-
5-
from edc_test_utils import DefaultTestSettings, func_main
6-
7-
app_name = "edc_locator"
8-
base_dir = Path(__file__).absolute().parent
9-
10-
project_settings = DefaultTestSettings(
11-
calling_file=__file__,
12-
template_dirs=[str(base_dir / app_name / "tests" / "templates")],
13-
BASE_DIR=base_dir,
14-
APP_NAME=app_name,
15-
ETC_DIR=str(base_dir / app_name / "tests" / "etc"),
16-
SILENCED_SYSTEM_CHECKS=[
17-
"sites.E101",
18-
"edc_navbar.E002",
19-
"edc_navbar.E003",
20-
"edc_consent.E001",
21-
],
22-
SUBJECT_VISIT_MODEL="edc_visit_tracking.subjectvisit",
23-
EDC_SITES_REGISTER_DEFAULT=True,
24-
INSTALLED_APPS=[
25-
"django.contrib.admin",
26-
"django.contrib.auth",
27-
"django.contrib.contenttypes",
28-
"django.contrib.sessions",
29-
"django.contrib.messages",
30-
"django.contrib.staticfiles",
31-
"django.contrib.sites",
32-
"simple_history",
33-
"django_crypto_fields.apps.AppConfig",
34-
"edc_action_item.apps.AppConfig",
35-
"edc_appointment.apps.AppConfig",
36-
"edc_auth.apps.AppConfig",
37-
"edc_data_manager.apps.AppConfig",
38-
"edc_device.apps.AppConfig",
39-
"edc_form_runners.apps.AppConfig",
40-
"edc_identifier.apps.AppConfig",
41-
"edc_lab.apps.AppConfig",
42-
"edc_label.apps.AppConfig",
43-
"edc_locator.apps.AppConfig",
44-
"edc_metadata.apps.AppConfig",
45-
"edc_notification.apps.AppConfig",
46-
"edc_registration.apps.AppConfig",
47-
"edc_sites.apps.AppConfig",
48-
"edc_visit_schedule.apps.AppConfig",
49-
"edc_visit_tracking.apps.AppConfig",
50-
"edc_appconfig.apps.AppConfig",
51-
],
52-
add_dashboard_middleware=True,
53-
).settings
54-
55-
56-
def main():
57-
func_main(project_settings, *[f"{app_name}.tests"])
58-
2+
from edc_test_settings.func_main import func_main2
593

604
if __name__ == "__main__":
61-
logging.basicConfig()
62-
main()
5+
func_main2("edc_locator.tests.test_settings", "edc_locator.tests")

0 commit comments

Comments
 (0)