Fixbuild tests and linter
This commit is contained in:
parent
0a49fb00e2
commit
27dffe7d08
@ -7,7 +7,7 @@ module Database.Esqueleto.Utils
|
||||
, SqlIn(..)
|
||||
) where
|
||||
|
||||
import ClassyPrelude.Yesod hiding (isInfixOf, (||.), any, all)
|
||||
import ClassyPrelude.Yesod hiding (isInfixOf, any, all)
|
||||
import qualified Data.Foldable as F
|
||||
import qualified Database.Esqueleto as E
|
||||
import Database.Esqueleto.Utils.TH
|
||||
|
||||
@ -93,6 +93,7 @@ fillDb = do
|
||||
gkleen <- insert User
|
||||
{ userIdent = "G.Kleen@campus.lmu.de"
|
||||
, userAuthentication = AuthLDAP
|
||||
, userLastAuthentication = Just now
|
||||
, userMatrikelnummer = Nothing
|
||||
, userEmail = "G.Kleen@campus.lmu.de"
|
||||
, userDisplayName = "Gregor Kleen"
|
||||
@ -109,6 +110,7 @@ fillDb = do
|
||||
fhamann <- insert User
|
||||
{ userIdent = "felix.hamann@campus.lmu.de"
|
||||
, userAuthentication = AuthLDAP
|
||||
, userLastAuthentication = Nothing
|
||||
, userMatrikelnummer = Nothing
|
||||
, userEmail = "felix.hamann@campus.lmu.de"
|
||||
, userDisplayName = "Felix Hamann"
|
||||
@ -125,6 +127,7 @@ fillDb = do
|
||||
jost <- insert User
|
||||
{ userIdent = "jost@tcs.ifi.lmu.de"
|
||||
, userAuthentication = AuthLDAP
|
||||
, userLastAuthentication = Nothing
|
||||
, userMatrikelnummer = Nothing
|
||||
, userEmail = "jost@tcs.ifi.lmu.de"
|
||||
, userDisplayName = "Steffen Jost"
|
||||
@ -141,6 +144,7 @@ fillDb = do
|
||||
maxMuster <- insert User
|
||||
{ userIdent = "max@campus.lmu.de"
|
||||
, userAuthentication = AuthLDAP
|
||||
, userLastAuthentication = Just now
|
||||
, userMatrikelnummer = Just "1299"
|
||||
, userEmail = "max@campus.lmu.de"
|
||||
, userDisplayName = "Max Musterstudent"
|
||||
@ -157,6 +161,7 @@ fillDb = do
|
||||
tinaTester <- insert $ User
|
||||
{ userIdent = "tester@campus.lmu.de"
|
||||
, userAuthentication = AuthLDAP
|
||||
, userLastAuthentication = Nothing
|
||||
, userMatrikelnummer = Just "999"
|
||||
, userEmail = "tester@campus.lmu.de"
|
||||
, userDisplayName = "Tina Tester"
|
||||
|
||||
@ -40,6 +40,7 @@ instance Arbitrary User where
|
||||
, on (\l d -> l <> "@" <> d) getPrintableString <$> arbitrary <*> arbitrary
|
||||
]
|
||||
userAuthentication <- arbitrary
|
||||
userLastAuthentication <- arbitrary
|
||||
userMatrikelnummer <- fmap pack . assertM' (not . null) <$> listOf (elements ['0'..'9'])
|
||||
userEmail <- CI.mk . decodeUtf8 . Email.toByteString <$> arbitrary
|
||||
|
||||
@ -60,7 +61,7 @@ instance Arbitrary User where
|
||||
userDownloadFiles <- arbitrary
|
||||
userMailLanguages <- arbitrary
|
||||
userNotificationSettings <- arbitrary
|
||||
|
||||
|
||||
return User{..}
|
||||
shrink = genericShrink
|
||||
|
||||
@ -71,7 +72,7 @@ instance Arbitrary File where
|
||||
fileModified <- (addUTCTime <$> arbitrary <*> pure (UTCTime date 0)) `suchThat` inZipRange
|
||||
fileContent <- arbitrary
|
||||
return File{..}
|
||||
where
|
||||
where
|
||||
inZipRange :: UTCTime -> Bool
|
||||
inZipRange time
|
||||
| time > UTCTime (fromGregorian 1980 1 1) 0
|
||||
|
||||
@ -92,7 +92,7 @@ authenticateAs (Entity _ User{..}) = do
|
||||
setMethod "GET"
|
||||
addRequestHeader ("Accept-Language", "de")
|
||||
setUrl $ AuthR LoginR
|
||||
|
||||
|
||||
request $ do
|
||||
setMethod "POST"
|
||||
addToken_ "#login--dummy"
|
||||
@ -107,6 +107,7 @@ createUser adjUser = do
|
||||
let
|
||||
userMatrikelnummer = Nothing
|
||||
userAuthentication = AuthLDAP
|
||||
userLastAuthentication = Nothing
|
||||
userIdent = "dummy@example.invalid"
|
||||
userEmail = "dummy@example.invalid"
|
||||
userDisplayName = "Dummy Example"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user