Advertisement
Guest User

BetterBlogBug

a guest
Jun 5th, 2020
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.55 KB | None | 0 0
  1. Today is the last day of `NOVA Web Development <https://novawebdevelopment.org/>`_'s Summer 2019 `sprint <https://en.wikipedia.org/wiki/Hackathon#Code_sprints>`_, time to do a write-up of what was accomplished.
  2.  
  3. I came to El Salvador with four concrete goals:
  4.  
  5. 1. To develop a working relationship with our NOVA Web Development members who live here, Natalia and German, whom we affectionately refer to
  6. as *team Guanaco*, including getting Natalia comfortable with project management in the context of web application development and getting German into a
  7. regular and hopefully sustainable rhythm as a web developer.
  8.  
  9. 2. To get as far as we could toward converting NOVA Web Development from an `Inc <https://en.wikipedia.org/wiki/Incorporation_(business)>`_
  10. to an `LLC <https://en.wikipedia.org/wiki/Limited_liability_company>`_ with an `operating agreement <https://en.wikipedia.org/wiki/Operating_agreement>`_
  11. establishing us as a `worker cooperative <https://en.wikipedia.org/wiki/Worker_cooperative>`_.
  12.  
  13. 3. To have German and Edzon get as close as they could toward a `minimum viable product <https://en.wikipedia.org/wiki/Minimum_viable_product>`_
  14. for `LibreOrganize <https://libreorganize.org/>`_, making optimal use of the kind assistance of their mentor, `Douglas Cerna <https://www.linkedin.com/in/douglas-cerna>`_.
  15.  
  16. 4. To have me learn enough `TDD <https://en.wikipedia.org/wiki/Test-driven_development>` with `Django <https://en.wikipedia.org/wiki/Django_(web_framework)>`_
  17. to be able to work with Edzon when I get back to add tests to the *Annual Report of Achievements* Django application we are developing for
  18. `Gallaudet University <https://en.wikipedia.org/wiki/Gallaudet_University>`_.
  19.  
  20. I am thrilled to say that we have accomplished either all or most of each of these goals.
  21.  
  22. A Strong Working Relationship and Next Steps for LibreOrganize
  23. -------------------------------------------------------------------------------------------------------
  24.  
  25. The first goal, naturally, is something that can only prove itself over time, but based on our experience together over the last four weeks, I believe Natalia is ready to help “take charge” of managing goal three,
  26. `LibreOrganize <https://libreorganize.org/>`_, and understands clearly what needs to be done to move the project forward.
  27.  
  28. We made a lot of progress toward the goal of a minimum viable product, which can be seen clearly in the commits to our `gitlab repo <https://gitlab.com/libreorganize/libreorganize>`_. Over the next few weeks
  29. and months we should:
  30.  
  31. 1. Have a working minimum viable product of LibreOrganize deployed on our own `NOVA Web Development <https://novawebdevelopment.org/>`_ website
  32. and begin `dogfooding <https://en.wikipedia.org/wiki/Eating_your_own_dog_food>`_ with it by using it for managing member access, forum discussions,
  33. and handling events.
  34.  
  35. 2. Port the NEA Members for Our Revolution website to LibreOrganize and use it to begin reaching out to the new members who signed up to the caucus at the
  36. NEA RA this past July in Houston.
  37.  
  38. 3. Port the NOVALACIRO website to LibreOrganize and use it for managing membership, membership IDs, and events.
  39.  
  40. 4. Discuss with the membership of Our Revolution Arlington (ORA) if they are interested in a ranked choice voting system that is not anonymous, and
  41. if they are develop such a system for them and port their website to LibreOrganize.
  42.  
  43. In the medium term, perhaps November to January, we should work with Douglas to port the helios voting system to LibreOrganize, building on the work already done, and use this to port the AEA to LibreOrganize.
  44.  
  45. Establishing NOVA Web Development as a Worker Cooperative
  46. ----------------------------------------------------------------------------------------------------
  47.  
  48. As of August 1, 2019, the state of Virginia recognizes `NOVA Web Development, LLC <https://cis.scc.virginia.gov/EntitySearch/BusinessInformation?businessId=1112063&source=FromEntityResult&isSeries=False>`_. We have a final draft of `our operating agreement <https://elkner.net/static/NOVAWebLimitedLiabilityCompanyOperatingAgreement.pdf>`_, which we will make public as soon as we sign it. We also discussed making our participation in next October’s Eastern Conference for Workplace Democracy our “coming out party” as a cooperative. I plan to investigate what it would mean for NOVA Web Development to join the United States Federation of Worker Cooperatives as soon as I get back to Virginia.
  49.  
  50. TDD with Django
  51. --------------------------
  52.  
  53. In one of the resources I am using in my Summer study, `Test-Driven Development with Django <https://www.packtpub.com/web-development/django-test-driven-development>`_, author Kevin Harvey states that there are four key practices to writing great code:
  54.  
  55. 1. Version control
  56. 2. Documentation
  57. 3. Testing
  58. 4. Continuous integration
  59.  
  60. We need to “skill up” on each of these practices to become a viable Django development business. Edzon and German are now comfortable enough with git that we have the first practice under control, and Kevin and I have written enough documentation over the years to be able to handle the second practice. It is testing and continuous integration that we do not yet know how to do, and my goal for these past four weeks has been start to get a handle on testing.
  61.  
  62. Starting a New TDD Django Project
  63. --------------------------------------------------------
  64.  
  65. 1. Create a directory for the project.
  66.  
  67. 2. Change to that directory and run::
  68.  
  69. $ pipenv install django selenium
  70. $ pipenv shell
  71. $ django-admin startproject [myproject] .
  72.  
  73. 3. Create a `.gitignore` file with contents::
  74.  
  75. [myproject].sqlite
  76. geckodriver.log
  77. __pycache__
  78. *.pyc
  79. /static
  80. .env
  81. .sw?
  82.  
  83. 4. Edit `myproject/settings.py` and set the database file to have desired name. I prefer having something along the lines of `projectname.sqlite` rather then the default db.sqlite3 since the name can better identify the database when it is being moved to another location.
  84.  
  85. 5. Create the first project app::
  86.  
  87. $ python manage.py startapp [myapp]
  88.  
  89. 6. Add a `functional_tests directory`, make it a module, and add first functional test::
  90.  
  91. $ mkdir functional_tests
  92. $ touch functional_tests/__init__.py
  93. $ vi functional_tests/test_myapp.py
  94.  
  95. 7. Put something like the following as the first functional test:
  96.  
  97. .. code-block:: python
  98.  
  99. from django.test import LiveServerTestCase
  100. from selenium import webdriver
  101.  
  102. class MyAppTest(LiveServerTestCase):
  103.  
  104. def setUp(self):
  105. self.browser = webdriver.Firefox()
  106. self.browser.implicitly_wait(2)
  107.  
  108. def tearDown(self):
  109. self.browser.quit()
  110.  
  111. def test_content_exists_on_homepage(self):
  112. home_page = self.browser.get(self.live_server_url + '/')
  113. self.fail('Incomplete Test')
  114.  
  115. 8. Run your first failing test::
  116.  
  117. $ python manage.py test functional_tests
  118.  
  119. 9. With the basic infrastructure now in place, add `user stories <https://en.wikipedia.org/wiki/User_story>`_ as comments,
  120. which will guide the writing of your first real `functional tests <https://en.wikipedia.org/wiki/Functional_testing>`_. Here is
  121. what I added to my first functional test::
  122.  
  123. def test_content_exists_on_homepage(self):
  124. """
  125. Test that a visitor sees the desired elements on the homepage.
  126. """
  127. # Natalia visits the elkner.net home page and is greated with
  128. # "Welcome to elkner.net!". She sees links to a blog, contact
  129. # info, and a resume.
  130. home_page = self.browser.get(self.live_server_url + '/')
  131. self.fail('Incomplete Test')
  132.  
  133. # Natalia sees an interesting quote on the page, and notices that
  134. # every time she reloads the page, the quote changes.
  135.  
  136. # She observes that the main body of the home page consists of lists
  137. # of links under headings describing their catagory. The layout is
  138. # easy on the eye and fits well in her desktop browser window.
  139.  
  140. # Later, she visits the site again from her mobile phone. She sees
  141. # that the layout has changed, and that items have been rearranged
  142. # to make viewing and navigation work well on the small screen of
  143. # her phone.
  144.  
  145. Now it’s time to start writing the functional tests to automate testing the user stories, and adding [unit tests](https://en.wikipedia.org/wiki/Unit_testing) as we work toward making the functional tests pass.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement