-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c26203
commit bae19c3
Showing
1 changed file
with
4 additions
and
82 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,9 @@ | ||
from app import create_app, db | ||
from app.models import Campaign | ||
|
||
def init_test_data(): | ||
app = create_app() | ||
with app.app_context(): | ||
# Clear existing data | ||
db.drop_all() | ||
db.create_all() | ||
|
||
# Create test campaign | ||
test_campaign = Campaign( | ||
title="Save the Local Park", | ||
description="Support our campaign to protect the local park from development", | ||
target_email="[email protected]", | ||
email_template="""Dear City Council, | ||
I am writing to express my concern about the proposed development of our local park. | ||
This space is vital to our community's wellbeing and environmental health. | ||
Please reject the current development proposal. | ||
Sincerely, | ||
[Your Name]""", | ||
goal=1000 | ||
) | ||
|
||
# Animal Vaccination Campaign | ||
vaccination_campaign = Campaign( | ||
title="Stop Forced Animal Vaccination in Kenya", | ||
description="Campaign against the mandatory vaccination program affecting livestock farmers across Kenya. This initiative impacts smallholder farmers' livelihoods and requires proper consultation.", | ||
target_email="[email protected]", | ||
email_template="""Dear Principal Secretary, | ||
I am writing to express serious concerns about the mandatory livestock vaccination program. | ||
Key issues: | ||
- Economic burden on smallholder farmers | ||
- Lack of proper stakeholder consultation | ||
- Need for flexible implementation timeline | ||
- Impact on traditional farming practices | ||
We request: | ||
1. Suspension of mandatory requirements | ||
2. Public participation in policy development | ||
3. Consider alternative approaches that respect farmer choices | ||
Sincerely, | ||
[Your Name]""", | ||
goal=500 | ||
) | ||
|
||
# Agricultural Bills Campaign | ||
agri_bills_campaign = Campaign( | ||
title="Protect Kenya's Food Security", | ||
description="Opposition to proposed agricultural bills that threaten local farming practices and food security. These bills could impact small-scale farmers and local food production.", | ||
target_email="[email protected]", | ||
email_template="""Dear Clerk of the National Assembly, | ||
I am writing regarding the proposed agricultural bills currently under consideration. | ||
Critical concerns: | ||
- Threat to small-scale farming | ||
- Impact on local food production | ||
- Excessive regulation of traditional farming | ||
- Risk to food sovereignty | ||
We urge the National Assembly to: | ||
1. Extend public participation period | ||
2. Conduct impact assessment on small-scale farmers | ||
3. Review provisions affecting traditional farming practices | ||
Sincerely, | ||
[Your Name]""", | ||
goal=1000 | ||
) | ||
|
||
db.session.add(test_campaign) | ||
db.session.add(vaccination_campaign) | ||
db.session.add(agri_bills_campaign) | ||
db.session.commit() | ||
from app import create_app | ||
from tests.fixtures import load_test_data | ||
|
||
app = create_app() | ||
|
||
if __name__ == '__main__': | ||
init_test_data() | ||
with app.app_context(): | ||
load_test_data() | ||
app.run(debug=True) |