Best Python code snippet using django-test-plus_python
test_pages.py
Source:test_pages.py
...32 return ['*']33 def _get_current_user(self):34 return Member.find(email='test@example.com')35class AppTest(AppTestCase):36 def assertResponseContains(self, url, substring):37 r = self.app.get(url)38 self.assertTrue(substring in r.data)39 def test_dashboard(self):40 self.assertResponseContains("/dashboard", "Dashboard")41 def test_place(self):42 self.assertResponseContains("/DL", "Delhi")43 def test_admin(self):44 self.assertResponseContains("/admin", "Admin Center")45 self.assertResponseContains("/admin/permission-groups", "Permission Groups")46 self.assertResponseContains("/admin/committee-structures", "Committee Structures")47 def test_volunteers(self):48 self.assertResponseContains("/DL/volunteers", "Volunteers")49 self.assertResponseContains("/DL/volunteers", "test@example.com")50 self.assertResponseContains("/DL/volunteers/add", "Add New Volunteer")51 def test_contacts(self):52 self.assertResponseContains("/DL/admin/contacts", "Contacts")53 def test_signups(self):54 self.assertResponseContains("/DL/signups", "Volunteer Signups")55 def test_voters(self):56 self.assertResponseContains("/DL/voters", "Voters")57 def test_committees(self):58 self.assertResponseContains("/DL/committees", "Committees")59 def test_signup(self):...
tests.py
Source:tests.py
...6 for _ in range(0, 20):7 self.presentation = PresentationFactory()8 def test_get_presentation_list_page(self):9 self.get_check_200(reverse('presentation:list'))10 self.assertResponseContains(PresentationFactory.subject, html=False)11 self.assertResponseContains(PresentationFactory.views, html=False)12 author = PresentationFactory.author.get_factory()13 self.assertResponseContains(author.username, html=False)14 def test_pagination(self):15 second_page_url = reverse('presentation:list') + "?page=2"16 self.get_check_200(second_page_url)17 self.assertResponseContains(18 '''<ul class="pagination text-center" role="navigation" aria-label="Pagination">''', html=False)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!