mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-19 21:26:05 -05:00
Segregation of Dev and Prod envs (#218)
Segregation of Dev and Prod envs, addition of tests Co-authored-by: Markos Gogoulos <mgogoulos@gmail.com> Co-authored-by: Ubuntu <shubhank@my-hostings.nxfutj5b2tlubjykddwgszqteb.bx.internal.cloudapp.net>
This commit is contained in:
13
tests/test_selenium_smoke.py
Normal file
13
tests/test_selenium_smoke.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from django.test import TestCase
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
|
||||
|
||||
|
||||
class SeleniumTest(TestCase):
|
||||
def setUp(self):
|
||||
self.chrome = webdriver.Remote(command_executor='http://selenium_hub:4444/wd/hub', desired_capabilities=DesiredCapabilities.CHROME)
|
||||
self.chrome.implicitly_wait(10)
|
||||
|
||||
def test_visit_site_with_chrome(self):
|
||||
self.chrome.get('http://web/admin')
|
||||
self.assertIn(self.chrome.title, "Log in | Django site admin")
|
||||
15
tests/users/factories.py
Normal file
15
tests/users/factories.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import factory
|
||||
from django.conf import settings
|
||||
from faker import Faker
|
||||
|
||||
fake = Faker()
|
||||
User = settings.AUTH_USER_MODEL
|
||||
|
||||
|
||||
class UserFactory(factory.django.DjangoModelFactory):
|
||||
class Meta:
|
||||
model = User
|
||||
|
||||
description = fake.paragraph(nb_sentences=4)
|
||||
name = fake.name()
|
||||
is_editor = True
|
||||
4
tests/users/test_sample.py
Normal file
4
tests/users/test_sample.py
Normal file
@@ -0,0 +1,4 @@
|
||||
def test_new_user(user_factory):
|
||||
print(user_factory.name)
|
||||
print(user_factory.description)
|
||||
assert True
|
||||
Reference in New Issue
Block a user